1
0
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:
Ilya Kreymer 2017-01-27 00:07:38 -08:00
parent f92782d1dd
commit 1a9f66f8b6

View File

@ -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