mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-25 08:11:54 +00:00
test(security): cover hostless HTTP URLs
(cherry picked from commit fad73d94d9)
This commit is contained in:
1 parent
724a184bdd
commit
8f6ad0f61e
1 file changed
+10
@@ -54,6 +54,16 @@ def test_validate_url_rejects_empty_scheme():
|
||||
with pytest.raises(ValueError):
|
||||
validate_url("//no-scheme.example.com")
|
||||
|
||||
@pytest.mark.parametrize("url", [
|
||||
"http://",
|
||||
"https://",
|
||||
"http:///etc/passwd",
|
||||
"https:///example.com/path",
|
||||
])
|
||||
def test_validate_url_rejects_missing_hostname(url):
|
||||
with pytest.raises(ValueError, match="without a hostname"):
|
||||
validate_url(url)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# safe_fetch - scheme and redirect guards (mocked network)
|
||||
|
||||
Reference in new issue
Block a user