Error pages return HTTP 200 instead of 404/500 #14
Locked
TheTechRobo
started this conversation in
General
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
Is this intentional?
Quick fix (untested):
@app.errorhandler(404) def page_not_found(e): error_code = "HTTP_404" error_text = "The requested page could not be found." - return render_template('error.html', error_code=error_code, error_text=error_text) + return render_template('error.html', error_code=error_code, error_text=error_text), 404 @app.errorhandler(500) def server_error(e): error_code = "HTTP_500" error_text = "The server has encountered an error. This isn't your fault- try your action again." - return render_template('error.html', error_code=error_code, errortext=error_text) + return render_template('error.html', error_code=error_code, errortext=error_text), 500Beta Was this translation helpful? Give feedback.
All reactions