From ac5b2484f9fb95b9ad2491ee74f085d3e514b371 Mon Sep 17 00:00:00 2001 From: Ruud Date: Thu, 31 May 2012 23:06:06 +0200 Subject: [PATCH] Redirect to complete request url. fix #375 --- couchpotato/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/couchpotato/__init__.py b/couchpotato/__init__.py index 3e283639..c3b1bd81 100644 --- a/couchpotato/__init__.py +++ b/couchpotato/__init__.py @@ -69,10 +69,10 @@ def getApiKey(): @app.errorhandler(404) def page_not_found(error): index_url = url_for('web.index') - url = getattr(request, 'path')[len(index_url):] + url = request.path[len(index_url):] if url[:3] != 'api': - return redirect(index_url + '#' + url) + return redirect(request.url.replace(request.path, index_url + '#' + url)) else: time.sleep(0.1) return 'Wrong API key used', 404