1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

memento: use replace_header() to avoid double adding Link, Memento-Datetime, Vary when using range request cache

This commit is contained in:
Ilya Kreymer 2016-09-29 15:22:44 -07:00
parent 4cdb99f415
commit e61078ab96

View File

@ -58,7 +58,7 @@ class MementoRespMixin(object):
not is_top_frame)
if is_timegate:
self.status_headers.headers.append(('Vary', 'accept-datetime'))
self.status_headers.replace_header('Vary', 'accept-datetime')
# Determine if memento:
is_memento = False
@ -100,8 +100,8 @@ class MementoRespMixin(object):
http_date = timestamp_to_http_date(ts)
if is_memento:
self.status_headers.headers.append(('Memento-Datetime',
http_date))
self.status_headers.replace_header('Memento-Datetime',
http_date)
canon_link = wbrequest.urlrewriter.get_new_url(mod=mod,
timestamp=ts,
@ -133,7 +133,7 @@ class MementoRespMixin(object):
link = ', '.join(link)
self.status_headers.headers.append(('Link', link))
self.status_headers.replace_header('Link', link)
def make_link(self, url, type):
return '<{0}>; rel="{1}"'.format(url, type)