← Back to Pull requests

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

Open
utsxvrai opened this pull request with 92 lines diff across 3 files
View on GitHub
utsxvrai utsxvrai commented on Nov 21, 2026 10:27 UTC
Author

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

  • I have read and agreed to the [Developer's Certificate of Origin][cert]

  • Tested

  • Benchmarked (optional)

  • Documented

  • Review ready

  • In review

  • Merge ready
  • [cert]: https://github.com/nodejs/undici/blob/main/CONTRIBUTING.md#developers-certificate-of-origin

    Diff: 92 lines (+79 / -13) across 3 files Reviewer: mcollina Review duration: 16887m
    All Vouch review confidence checks passed
    Residual risk 0.10 = Change Risk (0.33) × (1 − Review Confidence (0.71)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.33 · 92 lines diff across 3 files
    0.33
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.56 · 1 substantive comment(s)
    0.56
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    70%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.271
    Real PR Conversation Timeline
    3 items
    mcollina mcollina approved these changes on Nov 22, 2026 11:40 UTC
    Approved Reviewer

    Lgtm

    codecov-commenter codecov-commenter commented on Nov 22, 2026 12:04 UTC
    Contributor

    Codecov Report


    :white_check_mark: All modified and coverable lines are covered by tests.
    :white_check_mark: Project coverage is 91.74%. Comparing base (5d7f657) to head (2343316).
    :warning: Report is 1 commits behind head on main.

    <details><summary>Additional details and impacted files</summary>

    @@            Coverage Diff             @@
    ##             main    #6242      +/-   ##
    ==========================================
    - Coverage   91.74%   91.74%   -0.01%     
    ==========================================
      Files         113      113              
      Lines       44849    44844       -5     
    ==========================================
    - Hits        41147    41141       -6     
    - Misses       3702     3703       +1     
    

    </details>

    :umbrella: View full report in Codecov by Harness.
    :loudspeaker: Have feedback on the report? Share it here.
    <details><summary> :rocket: New features to boost your workflow: </summary>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

  • </details>

    Reviewers
    Assignees
    utsxvrai utsxvrai
    Labels
    risk: low confidence: 70.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 33% (LOW) · Higher = larger blast radius
    33%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 70.9% · Lower = rushed or shallow review
    70.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 9.6% · Safe to merge
    9.6%
    Repository