mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
webagg: response self-redir: don't check if live, throw correct exception
This commit is contained in:
parent
cca0c01547
commit
594aff86d3
@ -88,6 +88,9 @@ class BaseLoader(object):
|
|||||||
Check if response is a 3xx redirect to the same url
|
Check if response is a 3xx redirect to the same url
|
||||||
If so, reject this capture to avoid causing redirect loop
|
If so, reject this capture to avoid causing redirect loop
|
||||||
"""
|
"""
|
||||||
|
if cdx.get('is_live'):
|
||||||
|
return
|
||||||
|
|
||||||
if not status_code.startswith('3') or status_code == '304':
|
if not status_code.startswith('3') or status_code == '304':
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -104,7 +107,7 @@ class BaseLoader(object):
|
|||||||
msg = 'Self Redirect {0} -> {1}'
|
msg = 'Self Redirect {0} -> {1}'
|
||||||
msg = msg.format(request_url, location_url)
|
msg = msg.format(request_url, location_url)
|
||||||
#print(msg)
|
#print(msg)
|
||||||
raise WbException(msg)
|
raise LiveResourceException(msg)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _make_warc_id(id_=None):
|
def _make_warc_id(id_=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user