403 page
This commit is contained in:
@@ -319,6 +319,15 @@ def create_app():
|
||||
return {'error': 'not found'}, e.code
|
||||
else:
|
||||
return render_template('common/404.html'), e.code
|
||||
|
||||
@app.errorhandler(403)
|
||||
def _handle_403(e):
|
||||
if request.path.startswith('/hyperapi/'):
|
||||
return '<h1>forbiddedn</h1>', e.code
|
||||
elif request.path.startswith('/api/'):
|
||||
return {'error': 'forbidden'}, e.code
|
||||
else:
|
||||
return render_template('common/403.html'), e.code
|
||||
#
|
||||
# @app.errorhandler(413)
|
||||
# def _handle_413(e):
|
||||
|
||||
Reference in New Issue
Block a user