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

cdx: ensure url param required check is performed on init

This commit is contained in:
Ilya Kreymer 2016-02-22 13:59:07 -08:00
parent af7c876263
commit 57991fd0cf

View File

@ -7,8 +7,8 @@ from pywb.utils.canonicalize import calc_search_range
class CDXQuery(object):
def __init__(self, **kwargs):
self.params = kwargs
url = self.url
if not self.params.get('matchType'):
url = self.params.get('url', '')
if url.startswith('*.'):
self.params['url'] = url[2:]
self.params['matchType'] = 'domain'
@ -18,7 +18,7 @@ class CDXQuery(object):
else:
self.params['matchType'] = 'exact'
start, end = calc_search_range(url=self.params['url'],
start, end = calc_search_range(url=url,
match_type=self.params['matchType'],
url_canon=self.params.get('_url_canon'))