mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-25 16:22:30 +00:00
test(security): cover malformed URL ports
This commit is contained in:
1 parent
55a4fbcddc
commit
57d6217281
1 file changed
+10
@@ -55,6 +55,16 @@ def test_validate_url_rejects_empty_scheme():
|
||||
validate_url("//no-scheme.example.com")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("url", [
|
||||
"http://example.com:abc/path",
|
||||
"https://example.com:65536/path",
|
||||
"http://example.com:0/path",
|
||||
])
|
||||
def test_validate_url_rejects_invalid_port(url):
|
||||
with pytest.raises(ValueError, match="port"):
|
||||
validate_url(url)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# safe_fetch - scheme and redirect guards (mocked network)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user