mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-02-03 02:14:26 +00:00
web/postkey/views.py: allow only 2-level domains
Until we haven't implemented subdomain auth, reject subdomains registration via webinterface et all.
This commit is contained in:
parent
390ab411f7
commit
d6dfee3f78
@ -31,6 +31,8 @@ class AddForm(ModelForm):
|
||||
# Another set of reserved hostnames (suggested by zzz)
|
||||
if re.search(r'(^|\.)(i2p|i2p2|geti2p|mail|project|i2project|i2pproject|i2p-project).i2p$', data):
|
||||
raise forms.ValidationError('Trying to use hostname from additional reserved set')
|
||||
if data.count('.') > 1:
|
||||
raise forms.ValidationError('Currently only 2-level domains are allowed')
|
||||
return data
|
||||
def clean_b64hash(self):
|
||||
"""Validate base64 hash"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user