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 41
41
# than appear in Appendix B for scheme. This will prevent over-eager
42
42
# consuming of items that aren't schemes.
43
43
SCHEME_RE = '[a-zA-Z][a-zA-Z0-9+.-]*'
44
- _AUTHORITY_RE = '[^/?#]*'
44
+ _AUTHORITY_RE = '[^\\ \\ /?#]*'
45
45
_PATH_RE = '[^?#]*'
46
46
_QUERY_RE = '[^#]*'
47
47
_FRAGMENT_RE = '.*'
Original file line number Diff line number Diff line change @@ -351,3 +351,15 @@ def test_empty_querystrings_persist():
351
351
ref = URIReference .from_string (url )
352
352
assert ref .query == ''
353
353
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