Commit 09f3eec1 authored by David Haynes's avatar David Haynes 🙆
Browse files

Prevent redirecting to redirect loops (Closes #5)

- if some rougue admin adds a bunch of redirect loops, now those are handeled
- yayayay
parent e9064c5f
......@@ -281,6 +281,10 @@ def redirection(request, short):
url = get_object_or_404(URL, short__iexact=short)
url.clicks = url.clicks + 1
domain = "%s://%s" % (request.scheme, request.META.get('HTTP_HOST')) + "/"
if url.target == domain + short:
return redirect('404.html')
if 'qr' in request.GET:
url.qrclicks += 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment