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

wburl: support for new modifier form: $mod as well as 'mod_'

This commit is contained in:
Ilya Kreymer 2016-10-10 17:00:36 -07:00
parent 06b9e957e6
commit 7b45df7338
2 changed files with 4 additions and 1 deletions
pywb/rewrite

@ -13,6 +13,9 @@ u"""
>>> repr(WbUrl('20130102im_/https:/example.com')) >>> repr(WbUrl('20130102im_/https:/example.com'))
"('replay', '20130102', 'im_', 'https://example.com', '20130102im_/https://example.com')" "('replay', '20130102', 'im_', 'https://example.com', '20130102im_/https://example.com')"
>>> repr(WbUrl('20130102$cbr:test-foo.123/https:/example.com'))
"('replay', '20130102', '$cbr:test-foo.123', 'https://example.com', '20130102$cbr:test-foo.123/https://example.com')"
# Protocol agnostic convert to http # Protocol agnostic convert to http
>>> repr(WbUrl('20130102im_///example.com')) >>> repr(WbUrl('20130102im_///example.com'))
"('replay', '20130102', 'im_', 'http://example.com', '20130102im_/http://example.com')" "('replay', '20130102', 'im_', 'http://example.com', '20130102im_/http://example.com')"

@ -91,7 +91,7 @@ class WbUrl(BaseWbUrl):
# Regexs # Regexs
# ====================== # ======================
QUERY_REGEX = re.compile('^(?:([\w\-:]+)/)?(\d*)[*-](\d*)/?(.+)$') QUERY_REGEX = re.compile('^(?:([\w\-:]+)/)?(\d*)[*-](\d*)/?(.+)$')
REPLAY_REGEX = re.compile('^(\d*)([a-z]+_)?/{1,3}(.+)$') REPLAY_REGEX = re.compile('^(\d*)([a-z]+_|[$][a-z0-9:.-]+)?/{1,3}(.+)$')
#LATEST_REPLAY_REGEX = re.compile('^\w_)') #LATEST_REPLAY_REGEX = re.compile('^\w_)')
DEFAULT_SCHEME = 'http://' DEFAULT_SCHEME = 'http://'