aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/forms
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--webmentions_ssg/forms.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/webmentions_ssg/forms.py b/webmentions_ssg/forms.py
index c8ad0ba..1ce591d 100644
--- a/webmentions_ssg/forms.py
+++ b/webmentions_ssg/forms.py
@@ -104,7 +104,7 @@ class AllowedTargetHostname:
raise ValidationError(self.message or field.gettext("Invalid input."))
-class PublicIPLiteral:
+class RejectNonPublicIPLiteral:
"""Reject non-public IP literals without performing DNS in the web worker."""
def __call__(self, form: BaseForm, field: Field) -> None:
@@ -138,7 +138,12 @@ class WebmentionSubmissionForm(FlaskForm):
source = StringField(
"source",
- validators=[InputRequired(), MaxURLBytes(), StrictHTTPURL(), PublicIPLiteral()],
+ validators=[
+ InputRequired(),
+ MaxURLBytes(),
+ StrictHTTPURL(),
+ RejectNonPublicIPLiteral(),
+ ],
)
target = StringField(
"target",