File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ def _build_url(self, path: str) -> str:
7575 if "\\ " in stripped_path :
7676 raise HyperbrowserError ("path must not contain backslashes" )
7777 parsed_path = urlparse (stripped_path )
78- if parsed_path .scheme and parsed_path . netloc :
78+ if parsed_path .scheme :
7979 raise HyperbrowserError ("path must be a relative API path" )
8080 normalized_path = f"/{ stripped_path .lstrip ('/' )} "
8181 if normalized_path == "/api" or normalized_path .startswith ("/api/" ):
Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ def test_client_build_url_rejects_empty_or_non_string_paths():
5555 client ._build_url (r"\\session" )
5656 with pytest .raises (HyperbrowserError , match = "path must be a relative API path" ):
5757 client ._build_url ("https://api.hyperbrowser.ai/session" )
58+ with pytest .raises (HyperbrowserError , match = "path must be a relative API path" ):
59+ client ._build_url ("mailto:ops@hyperbrowser.ai" )
60+ with pytest .raises (HyperbrowserError , match = "path must be a relative API path" ):
61+ client ._build_url ("http:example.com" )
5862 finally :
5963 client .close ()
6064
You can’t perform that action at this time.
0 commit comments