From d6dfee3f78628113ff555498fd24bad1c9eafabf Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Fri, 29 Oct 2010 17:50:21 +0000 Subject: [PATCH] web/postkey/views.py: allow only 2-level domains Until we haven't implemented subdomain auth, reject subdomains registration via webinterface et all. --- web/postkey/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/postkey/views.py b/web/postkey/views.py index ab690f1..6e04a03 100644 --- a/web/postkey/views.py +++ b/web/postkey/views.py @@ -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"""