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:
parent
af7c876263
commit
57991fd0cf
@ -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'))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user