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

replay redirect: ensure no timestamp redirect when range request is

present, alter test to include inexact timestamp
This commit is contained in:
Ilya Kreymer 2014-12-23 21:19:39 -08:00
parent 181c18a1b8
commit ad5a43db76
3 changed files with 5 additions and 1 deletions

View File

@ -143,6 +143,7 @@ class WbRequest(object):
return None
start = int(start)
self.custom_params['noredir'] = True
if end:
end = int(end)

View File

@ -224,6 +224,9 @@ class ReplayView(object):
if not redir_needed:
return None
if self.enable_range_cache and wbrequest.extract_range():
return None
new_url = (wbrequest.urlrewriter.
get_new_url(timestamp=cdx['timestamp'],
url=cdx['original']))

View File

@ -173,7 +173,7 @@ class TestWb:
def test_replay_range_cache_content(self):
headers = [('Range', 'bytes=0-200')]
resp = self.testapp.get('/pywb/20140127171251id_/http://example.com', headers=headers)
resp = self.testapp.get('/pywb/20140127171250id_/http://example.com', headers=headers)
assert resp.status_int == 206
assert resp.headers['Accept-Ranges'] == 'bytes'