mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
memento: use replace_header() to avoid double adding Link, Memento-Datetime, Vary when using range request cache
This commit is contained in:
parent
4cdb99f415
commit
e61078ab96
@ -58,7 +58,7 @@ class MementoRespMixin(object):
|
|||||||
not is_top_frame)
|
not is_top_frame)
|
||||||
|
|
||||||
if is_timegate:
|
if is_timegate:
|
||||||
self.status_headers.headers.append(('Vary', 'accept-datetime'))
|
self.status_headers.replace_header('Vary', 'accept-datetime')
|
||||||
|
|
||||||
# Determine if memento:
|
# Determine if memento:
|
||||||
is_memento = False
|
is_memento = False
|
||||||
@ -100,8 +100,8 @@ class MementoRespMixin(object):
|
|||||||
http_date = timestamp_to_http_date(ts)
|
http_date = timestamp_to_http_date(ts)
|
||||||
|
|
||||||
if is_memento:
|
if is_memento:
|
||||||
self.status_headers.headers.append(('Memento-Datetime',
|
self.status_headers.replace_header('Memento-Datetime',
|
||||||
http_date))
|
http_date)
|
||||||
|
|
||||||
canon_link = wbrequest.urlrewriter.get_new_url(mod=mod,
|
canon_link = wbrequest.urlrewriter.get_new_url(mod=mod,
|
||||||
timestamp=ts,
|
timestamp=ts,
|
||||||
@ -133,7 +133,7 @@ class MementoRespMixin(object):
|
|||||||
|
|
||||||
link = ', '.join(link)
|
link = ', '.join(link)
|
||||||
|
|
||||||
self.status_headers.headers.append(('Link', link))
|
self.status_headers.replace_header('Link', link)
|
||||||
|
|
||||||
def make_link(self, url, type):
|
def make_link(self, url, type):
|
||||||
return '<{0}>; rel="{1}"'.format(url, type)
|
return '<{0}>; rel="{1}"'.format(url, type)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user