aboutsummaryrefslogtreecommitdiff
path: root/tests/test_forms.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/test_forms.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_forms.py b/tests/test_forms.py
index a37a6d0..e636eae 100644
--- a/tests/test_forms.py
+++ b/tests/test_forms.py
@@ -178,6 +178,18 @@ def test_endpoint_rejects_private_ip_literals(app: Flask, source: str) -> None:
assert "URL must use a public address." in form.errors["source"]
+def test_endpoint_rejects_private_ip_literal_with_trailing_dot(app: Flask) -> None:
+ with app.test_request_context("/endpoint", method="POST"):
+ form = EndpointForm(
+ formdata=MultiDict(
+ {"source": "http://127.0.0.1./", "target": VALID_TARGET}
+ ),
+ meta={"csrf": False},
+ )
+ assert not form.validate()
+ assert "URL must use a public address." in form.errors["source"]
+
+
def test_endpoint_handles_malformed_ipv6_without_crashing(app: Flask) -> None:
with app.test_request_context("/endpoint", method="POST"):
form = EndpointForm(