-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise an exception on request body reading after sending response #2895
Comments
Should it be "after respond ends"? |
I don't see a big difference but "after respond ends" sounds good |
If the POST data is not read when respond ends, what should be done? Read the entire post data to make the connection ready for the next request, or close it forcely? The post data might be very large, but forcely close the connection may break the "Connection: keep-alive" in the previous response. A mark could be set after that to stop further reads. |
It should be "read the entire post data" and "do nothing". The connection cannot be forcely closed, or the response might be lost due to connection reset (client write to a closed connection resets the connection) |
From my perspective we have two cases:
|
@asvetlov after reading the code, I found it already implemented aiohttp/aiohttp/web_protocol.py Lines 422 to 434 in c5d3999
Seems that it reads for |
Yes. The only thing is left: close payload as well. Now it is possible to read payload (StreamReader) data after sending response, which is weird and error prone. I thing |
Fixed by #2927 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
See #2893 for the issue motivation
The text was updated successfully, but these errors were encountered: