Redirect to complete request url. fix #375
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user