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

self-redirect check: run redirect check if status code is blank or does not start with 2, 4, 5,

to more aggressively check invalid status codes, should fix ukwa/ukwa-pywb#21
This commit is contained in:
Ilya Kreymer 2018-03-02 14:50:17 -08:00 committed by John Berlin
parent 871cef26a8
commit f30b280437
No known key found for this signature in database
GPG Key ID: 6EF5E4B442011B02

View File

@ -204,8 +204,10 @@ class WARCPathLoader(DefaultResolverMixin, BaseLoader):
http_headers_buff = None
if payload.rec_type in ('response', 'revisit'):
status = cdx.get('status')
# status may not be set for 'revisit'
if not status or status.startswith('3'):
# if status is not set and not, 2xx, 4xx, 5xx
# go through self-redirect check just in case
if not status or not status.startswith(('2', '4', '5')):
http_headers = self.headers_parser.parse(payload.raw_stream)
try: