-
Notifications
You must be signed in to change notification settings - Fork 30k
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
http: be more aggressive to reply 400, 408 and 431 #44818
http: be more aggressive to reply 400, 408 and 431 #44818
Conversation
As long as data of the in-flight response is not yet written to the socket, we can reply an error response without corrupting the client.
Review requested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once CI failures are fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
remove obsolete comment
fix comment Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Shall we proceed to get this PR landed? |
Landed in 6475a87 |
As long as data of the in-flight response is not yet written to the socket, we can reply an error response without corrupting the client. PR-URL: #44818 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Fix #37685, which is introduced in e8d7fed. It is too conservate (from the perspective from avoiding corrupting the client) to reply an error message.
Cases where we should reply an error message are covered in those 4 tests this PR modified, while the case where the socket should be immediately destroyed is covered in test/parallel/test-http-header-badrequest.js.