mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-26 00:30:27 +00:00
test(security): cover malformed URL ports
(cherry picked from commit 57d6217281)
This commit is contained in:
1 parent
53bfe14613
commit
52dea94b01
1 file changed
+10
@@ -65,6 +65,16 @@ def test_validate_url_rejects_missing_hostname(url):
|
||||
validate_url(url)
|
||||
|
||||
|
||||
@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