mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
wburl to_uri: when parsing scheme, also for first '?' in addition to '/' to catch any irregular urls (to be ignored)
This commit is contained in:
parent
d39f26872d
commit
b21e288063
@ -76,6 +76,12 @@ http://xn--e1afmkfd.xn--80akhbyknj4f
|
|||||||
>>> print(WbUrl.to_uri('https://xn--e1afmkfd.xn--80akhbyknj4f/foo/bar?abc=def'))
|
>>> print(WbUrl.to_uri('https://xn--e1afmkfd.xn--80akhbyknj4f/foo/bar?abc=def'))
|
||||||
https://xn--e1afmkfd.xn--80akhbyknj4f/foo/bar?abc=def
|
https://xn--e1afmkfd.xn--80akhbyknj4f/foo/bar?abc=def
|
||||||
|
|
||||||
|
>>> print(WbUrl.to_uri('somescheme://test?foo=bar%9F'))
|
||||||
|
somescheme://test?foo=bar%9F
|
||||||
|
|
||||||
|
>>> print(WbUrl.to_uri('/test/foo=bar%9F'))
|
||||||
|
/test/foo=bar%9F
|
||||||
|
|
||||||
# truncated
|
# truncated
|
||||||
>>> print(WbUrl.to_uri('http://' + quote_plus(u'пример.испытание'.encode('utf-8'))[1:]))
|
>>> print(WbUrl.to_uri('http://' + quote_plus(u'пример.испытание'.encode('utf-8'))[1:]))
|
||||||
http://xn--d0-olcluwd.xn--80akhbyknj4f
|
http://xn--d0-olcluwd.xn--80akhbyknj4f
|
||||||
|
@ -91,7 +91,7 @@ class WbUrl(BaseWbUrl):
|
|||||||
|
|
||||||
DEFAULT_SCHEME = 'http://'
|
DEFAULT_SCHEME = 'http://'
|
||||||
|
|
||||||
FIRST_PATH = re.compile('(?<![:/])/(?![/])')
|
FIRST_PATH = re.compile('(?<![:/])[/?](?![/])')
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user