Repository navigation
Conversation
An HTTP/1.1 100 response received without an Expect: 100-continue request was treated as a bad response and destroyed the socket. RFC 9110 15.2.1 allows a client to discard it, and the README already documents that it is ignored. Handle it like any other 1xx informational response. Fixes: nodejs#5899 Signed-off-by: utsxvrai <utsavrai2115@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This relates to...
Fixes #5899
Rationale
When an HTTP/1.1 server sends a
100 Continuethat the client never asked for (noExpect: 100-continue), undici destroys the socket withSocketError: bad response. RFC 9110 §15.2.1 lets a client discard such a response, browsers move on to the final response, and our README ("Expect" section) already says the 100 is ignored. This is the same idea as #5918, which was closed without review.Changes
Features
N/A
Bug Fixes
client-h1: drop the special case that treated a 100 status as a bad response. It now goes through the same path as other 1xx informational responses, and the final response plus connection reuse work as expected.test/http-100.js: theerror 100 bodytest asserted the old behaviour; replaced it withignore unsolicited 100 response.test/issue-5899.jscoveringClient(including keep-alive reuse) andfetch.Breaking Changes and Deprecations
N/A
Tests
node --test test/issue-5899.js test/http-100.js test/http2-informational.js: 8/8 pass (issue-5899 fails on main withbad response)node --test test/client*.js test/http-*.js test/issue-*.js test/request*.js test/pipeline*.js test/fetch/client-fetch.js: 501 tests, 0 failuresAI assistance: the code and tests were generated with a coding agent; I verified them by running the tests listed above and reviewing the diff.
Status