Describe the bug
Causing a connection to keep-alive will make the application not consume the request body on PUT, DELETE and POST for example. This only happens when the request exits, for example due to bad input before the body is consumed in the code. The {} will pass over to the next request, causing internal issues and malformed responses.
Steps to reproduce
Start the application with proper configuration
Send requests to endpoints that require a request body
Requests should include keep-alive
Send invalid data, so the endpoint exists the function prematurely
Expected behavior
The body gets consumed, and not passed over.
Actual behavior
The {} get passed over to the next request.
Screenshots
N/A
Operating System:
N/A
Additional context
When you set the request body to {} with Postman or any HTTP clients, the first request will return 200, while the second request will return a 405 error response. The log shows the request method is {}POST:
This can be avoided running a production WSGI server like gunicorn.
Furthermore closing the connection while in the development version will fix the issue.
Non operating system dependent.
Reassigned priority as it's unknown if this is fixable due to the issue being Flask-dependant, but it's worth to note, and possibly to eventually work around.
From
DeadlyFirex/PrimoTracker
Describe the bug Causing a connection to
keep-alive
will make the application not consume the request body onPUT
,DELETE
andPOST
for example. This only happens when the request exits, for example due to bad input before the body is consumed in the code. The{}
will pass over to the next request, causing internal issues and malformed responses.Steps to reproduce
keep-alive
Expected behavior The body gets consumed, and not passed over.
Actual behavior The
{}
get passed over to the next request.Screenshots N/A
Operating System: N/A
Additional context
See the following issue: https://github.com/pallets/flask/issues/4507 for more information.
This can be avoided running a production WSGI server like
gunicorn
. Furthermore closing the connection while in the development version will fix the issue. Non operating system dependent.