File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ def _build_url(self, path: str) -> str:
7272 stripped_path = path .strip ()
7373 if not stripped_path :
7474 raise HyperbrowserError ("path must not be empty" )
75+ if "\\ " in stripped_path :
76+ raise HyperbrowserError ("path must not contain backslashes" )
7577 parsed_path = urlparse (stripped_path )
7678 if parsed_path .scheme and parsed_path .netloc :
7779 raise HyperbrowserError ("path must be a relative API path" )
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ def test_client_build_url_rejects_empty_or_non_string_paths():
4949 client ._build_url (" " )
5050 with pytest .raises (HyperbrowserError , match = "path must be a string" ):
5151 client ._build_url (123 ) # type: ignore[arg-type]
52+ with pytest .raises (
53+ HyperbrowserError , match = "path must not contain backslashes"
54+ ):
55+ client ._build_url (r"\\session" )
5256 with pytest .raises (HyperbrowserError , match = "path must be a relative API path" ):
5357 client ._build_url ("https://api.hyperbrowser.ai/session" )
5458 finally :
You can’t perform that action at this time.
0 commit comments