mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-01-09 06:18:05 +00:00
validation.py: check for http:/ in hostname
This is a common error.
This commit is contained in:
parent
5da0cc4b59
commit
b5c5a4051c
@ -26,6 +26,8 @@ def validate_hostname(data):
|
||||
# prevent common errors
|
||||
if re.match(r'\.i2p$', data):
|
||||
raise forms.ValidationError('Incomplete hostname')
|
||||
if re.match(r'^http:/', data):
|
||||
raise forms.ValidationError('Do not paste full URL, just domain')
|
||||
# Must not contain '..'
|
||||
if re.search(r'\.\.', data):
|
||||
raise forms.ValidationError('".." in hostname')
|
||||
|
Loading…
Reference in New Issue
Block a user