mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
mementoindexsource: treat missing Link header as non-memento/not found
This commit is contained in:
parent
f92782d1dd
commit
1a9f66f8b6
@ -317,12 +317,17 @@ class MementoIndexSource(BaseIndexSource):
|
||||
if res.status_code >= 400:
|
||||
raise NotFoundException(url)
|
||||
|
||||
return res.headers.get('Link')
|
||||
links = res.headers.get('Link')
|
||||
|
||||
if not links:
|
||||
raise NotFoundException(url)
|
||||
|
||||
return links
|
||||
|
||||
def get_timemap_links(self, params):
|
||||
url = res_template(self.timemap_url, params)
|
||||
res = requests.get(url, timeout=params.get('_timeout'))
|
||||
if res.status_code >= 400:
|
||||
if res.status_code >= 400 or not res.text:
|
||||
raise NotFoundException(url)
|
||||
|
||||
return res.text
|
||||
|
Loading…
x
Reference in New Issue
Block a user