Skip to content

fix(client): ignore unsolicited 100 Continue responses - #6242

Open
utsxvrai wants to merge 1 commit into
nodejs:mainfrom
utsxvrai:fix/ignore-unsolicited-100-continue
Open

utsxvrai wants to merge 1 commit into
nodejs:mainfrom
utsxvrai:fix/ignore-unsolicited-100-continue

Conversation

@utsxvrai

@utsxvrai utsxvrai commented Nov 21, 2026 •

Copy link
Copy Markdown

This relates to...

Fixes #5899

Rationale

When an HTTP/1.1 server sends a 100 Continue that the client never asked for (no Expect: 100-continue), undici destroys the socket with SocketError: 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: the error 100 body test asserted the old behaviour; replaced it with ignore unsolicited 100 response.
  • Added test/issue-5899.js covering Client (including keep-alive reuse) and fetch.

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 with bad 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 failures
  • eslint clean on changed files

AI 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

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fetch should ignore unsolicited 100 Continue responses

1 participant