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

fuzzymatcher: better fix for mime-type matching if no mime

This commit is contained in:
Ilya Kreymer 2017-04-25 14:48:09 -07:00
parent b3bc7765a1
commit 24c968640d

View File

@ -162,8 +162,12 @@ class FuzzyMatcher(object):
if not rule.match_filters:
return True
mime = cdx.get('mime')
if not mime:
return False
for match_filter in rule.match_filters:
if match_filter['mime'] in (cdx.get('mime', ''), '*'):
if match_filter['mime'] in (mime, '*'):
return match_filter['match'].search(url)
return False