handle 413
This commit is contained in:
@@ -246,6 +246,15 @@ def create_app():
|
||||
else:
|
||||
return render_template('common/404.html'), e.code
|
||||
|
||||
@app.errorhandler(413)
|
||||
def _handle_413(e):
|
||||
if request.path.startswith('/hyperapi/'):
|
||||
return '<h1>request body too large</h1>', e.code
|
||||
elif request.path.startswith('/api/'):
|
||||
return {'error': 'body too large'}, e.code
|
||||
else:
|
||||
return render_template('common/413.html'), e.code
|
||||
|
||||
# this only happens at build time but
|
||||
# build time is when updates are done anyway
|
||||
# sooo... /shrug
|
||||
|
||||
Reference in New Issue
Block a user