1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-01-09 06:18:05 +00:00

web/jump/views.py: fix redirects

Accessing invalid or unknown hostnames always caused a redirect loop.
This commit is contained in:
Hidden Z 2010-10-24 07:08:37 +00:00
parent 700391d6e8
commit 3230f07160

View File

@ -10,11 +10,11 @@ def jumper(request, data):
try:
hostname = validate_hostname(data)
except ValidationError, e:
return redirect('error/')
return redirect('/jump/error/')
try:
key = i2phost.objects.get(name=hostname, activated=True).b64hash
except i2phost.DoesNotExist:
return redirect('unknown/')
return redirect('/jump/unknown/')
url = 'http://' + hostname + '/?i2paddresshelper=' + key
return redirect(url, permanent=True)