mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
fuzzy matching: apply fuzzy match if url prefix and regex match, even if no groups are captured by the regex (#524)
This commit is contained in:
parent
0be84520ed
commit
523e35d973
@ -84,7 +84,7 @@ class FuzzyMatcher(object):
|
|||||||
m = rule.regex.search(urlkey)
|
m = rule.regex.search(urlkey)
|
||||||
groups = m and m.groups()
|
groups = m and m.groups()
|
||||||
|
|
||||||
if not groups:
|
if groups is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
matched_rule = rule
|
matched_rule = rule
|
||||||
@ -99,7 +99,7 @@ class FuzzyMatcher(object):
|
|||||||
|
|
||||||
# support matching w/o query if no additional filters
|
# support matching w/o query if no additional filters
|
||||||
# don't include trailing '?' if no filters and replace_after '?'
|
# 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)
|
inx = url.find(matched_rule.replace_after)
|
||||||
if inx > 0:
|
if inx > 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user