File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 4141# than appear in Appendix B for scheme. This will prevent over-eager
4242# consuming of items that aren't schemes.
4343SCHEME_RE = '[a-zA-Z][a-zA-Z0-9+.-]*'
44- _AUTHORITY_RE = '[^/?#]*'
44+ _AUTHORITY_RE = '[^\\ \\ /?#]*'
4545_PATH_RE = '[^?#]*'
4646_QUERY_RE = '[^#]*'
4747_FRAGMENT_RE = '.*'
Original file line number Diff line number Diff line change @@ -351,3 +351,15 @@ def test_empty_querystrings_persist():
351351 ref = URIReference .from_string (url )
352352 assert ref .query == ''
353353 assert ref .unsplit () == url
354+
355+
356+ def test_wide_domain_bypass_check ():
357+ """Verify we properly parse/handle the authority.
358+
359+ See also:
360+ https://bugs.xdavidhu.me/google/2020/03/08/the-unexpected-google-wide-domain-check-bypass/
361+ """
362+ url = "https://user:[email protected] \\ test.corp.google.com:8080/path/to/something?param=value#hash" 363+ ref = URIReference .from_string (url )
364+ assert ref .scheme == "https"
365+ assert ref .host == "xdavidhu.me"
You can’t perform that action at this time.
0 commit comments