diff --git a/pywb/warcserver/index/fuzzymatcher.py b/pywb/warcserver/index/fuzzymatcher.py index 618b64f2d..178c2ce43 100644 --- a/pywb/warcserver/index/fuzzymatcher.py +++ b/pywb/warcserver/index/fuzzymatcher.py @@ -84,7 +84,7 @@ def get_fuzzy_match(self, urlkey, url, params): m = rule.regex.search(urlkey) groups = m and m.groups() - if not groups: + if groups is None: continue matched_rule = rule @@ -99,7 +99,7 @@ def get_fuzzy_match(self, urlkey, url, params): # support matching w/o query if no additional filters # don't include trailing '?' if no filters and replace_after '?' - no_filters = (filters == {'urlkey:'}) and (matched_rule.replace_after == '?') + no_filters = (not filters or filters == {'urlkey:'}) and (matched_rule.replace_after == '?') inx = url.find(matched_rule.replace_after) if inx > 0: