Browse Source

Redirect fix

pull/489/head
Ruud 13 years ago
parent
commit
081a4b4643
  1. 6
      couchpotato/__init__.py

6
couchpotato/__init__.py

@ -72,7 +72,11 @@ def page_not_found(error):
url = request.path[len(index_url):]
if url[:3] != 'api':
return redirect(request.url.replace(request.path, index_url + '#' + url))
if request.path != '/':
r = request.url.replace(request.path, index_url + '#' + url)
else:
r = '%s%s' % (request.url.rstrip('/'), index_url + '#' + url)
return redirect(r)
else:
time.sleep(0.1)
return 'Wrong API key used', 404

Loading…
Cancel
Save