I'm trying to limit upload file size, I set app.config['MAX_CONTENT_LENGTH'] to the maximum value I want,
I used this code to display the error.
@app.errorhandler(413)
def request_entity_too_large(error):
return 'File Too Large', 413
When using curl, the error displayed correctly.
I checked using Firefox/Safari, in both I get browser error of connection dropped/reset.
Firefox
The connection was reset
The connection to the server was reset while the page was loading.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
Safari
Can't open the page
...server unexpectedly dropped the connection...
server log in all of those requests
192.168.1.1 - - [23/May/2015 15:50:34] "POST / HTTP/1.1" 413 -
Why the error doesn't display correctly?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…