File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,10 @@ def _build_url(self, path: str) -> str:
9191 raw_query_component = (
9292 stripped_path .split ("?" , 1 )[1 ] if "?" in stripped_path else ""
9393 )
94+ if "?" in raw_query_component or "#" in raw_query_component :
95+ raise HyperbrowserError (
96+ "path query must not contain unencoded delimiter characters"
97+ )
9498 if any (
9599 character .isspace () or ord (character ) < 32 or ord (character ) == 127
96100 for character in raw_query_component
Original file line number Diff line number Diff line change @@ -326,6 +326,11 @@ def test_client_build_url_rejects_empty_or_non_string_paths():
326326 match = "path query must not contain unencoded whitespace or control characters" ,
327327 ):
328328 client ._build_url ("/session?foo=bar baz" )
329+ with pytest .raises (
330+ HyperbrowserError ,
331+ match = "path query must not contain unencoded delimiter characters" ,
332+ ):
333+ client ._build_url ("/session?foo=bar?baz" )
329334 with pytest .raises (
330335 HyperbrowserError ,
331336 match = "path query must not contain unencoded whitespace or control characters" ,
You can’t perform that action at this time.
0 commit comments