1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-01-22 20:44:55 +00:00

web/lib/validation.py: disallow localhost.*

This commit is contained in:
Hidden Z 2010-10-29 17:45:10 +00:00
parent f34a78c9ab
commit 893d84c08f

View File

@ -53,6 +53,9 @@ def validate_hostname(data):
# Certain hostnames reserved for project use are not allowed
if re.search(r'(^|\.)(proxy|router|console|b32|b64)$', namepart):
raise forms.ValidationError('Trying to use reserved hostname')
# Block various localhost.* in addition
if re.match(r'^localhost($|\..*$)', namepart):
raise forms.ValidationError('localhost.* not allowed')
return data