File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -460,3 +460,13 @@ def test_client_config_normalize_base_url_validates_and_normalizes():
460460 ClientConfig .normalize_base_url (
461461 f"https://example.local/{ deeply_encoded_dot } /api"
462462 )
463+ deeply_encoded_host_label = "%61"
464+ for _ in range (11 ):
465+ deeply_encoded_host_label = quote (deeply_encoded_host_label , safe = "" )
466+ with pytest .raises (
467+ HyperbrowserError ,
468+ match = "base_url host contains excessively nested URL encoding" ,
469+ ):
470+ ClientConfig .normalize_base_url (
471+ f"https://{ deeply_encoded_host_label } .example.local"
472+ )
Original file line number Diff line number Diff line change @@ -163,6 +163,16 @@ def test_client_build_url_rejects_runtime_invalid_base_url_changes():
163163 ):
164164 client ._build_url ("/session" )
165165
166+ deeply_encoded_host_label = "%61"
167+ for _ in range (11 ):
168+ deeply_encoded_host_label = quote (deeply_encoded_host_label , safe = "" )
169+ client .config .base_url = f"https://{ deeply_encoded_host_label } .example.local"
170+ with pytest .raises (
171+ HyperbrowserError ,
172+ match = "base_url host contains excessively nested URL encoding" ,
173+ ):
174+ client ._build_url ("/session" )
175+
166176 client .config .base_url = "https://example.local%2Fapi"
167177 with pytest .raises (
168178 HyperbrowserError ,
You can’t perform that action at this time.
0 commit comments