我试图限制上传文件的大小,我将app.config ['MAX_CONTENT_LENGTH']设置为所需的最大值,
我使用此代码显示错误。
@app.errorhandler(413)
def request_entity_too_large(error):
return 'File Too Large', 413
Run Code Online (Sandbox Code Playgroud)
使用curl时,错误显示正确。我使用Firefox / Safari进行了检查,在这两种情况下,我均收到浏览器连接断开/重置错误。
火狐浏览器
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.
Run Code Online (Sandbox Code Playgroud)
苹果浏览器
Can't open the page
...server unexpectedly dropped the connection...
Run Code Online (Sandbox Code Playgroud)
服务器登录所有这些请求
192.168.1.1 - - [23/May/2015 15:50:34] "POST / HTTP/1.1" 413 -
Run Code Online (Sandbox Code Playgroud)
为什么错误无法正确显示?
| 归档时间: |
|
| 查看次数: |
1058 次 |
| 最近记录: |