1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-01-10 06:47:58 +00:00
Commit Graph

12 Commits

Author SHA1 Message Date
Hidden Z
2ab7b2de5f validation.py: Allow only 4ld domains and below 2010-10-22 18:29:42 +00:00
Hidden Z
0c45032178 validation.py: enhance IDN-check
Previously olny IDN hostnames which starts with xn-- was allowed, now
subdomains like subdomains.xn--foobar.i2p are also allowed.
2010-10-22 18:02:47 +00:00
Hidden Z
ac3df58a3f validation.py: hostname must not start with '.' or '-'
I just forgot to add this rule earlier.
2010-10-22 17:48:47 +00:00
Hidden Z
76e4ee94ce validation.py: add hostname lenght check
That's not really needed, just added for avoiding
django.db.utils.DatabaseError exceptions when trying to add too long
hostname with py-i2phosts-injector
2010-10-22 17:47:27 +00:00
Hidden Z
01e01b98fa validation.py: bugfix: look for '..' in a whole hostname, not in namepart only 2010-10-22 17:15:59 +00:00
Hidden Z
573efddf8b validation.py: strip leading and trailing whitespaces from hostname 2010-10-22 17:14:30 +00:00
Hidden Z
6a50774e5f web/lib/validation.py: add comment 2010-10-21 18:47:50 +00:00
Hidden Z
bb2582c62c web/lib/validation.py: add base64-validity check
Base 64 hash shouldn't require more than 2 pad chars to be divided to 4
without leftover.
2010-10-21 18:44:02 +00:00
Hidden Z
2b535dbf2b web/lib/validation.py: new b64 length check
b64 hash shouldn't be longer than 616 bytes. We already have length
limit in database model, but this way we can provide our custom error
message.
2010-10-21 18:40:02 +00:00
Hidden Z
bc3118ab44 web/lib/validation.py: call len() for "data" only once
Sort of optimisation.
2010-10-21 18:38:57 +00:00
Hidden Z
f3a79838e6 web/lib/validation.py: fix base64 validations according to zzz's explanation 2010-10-16 19:03:54 +00:00
Hidden Z
2769f0d4bc Move validation functions to separate module 2010-10-16 18:30:08 +00:00