Skip to content

http: send queued informational responses first - #67959

Open
inoway46 wants to merge 1 commit into
nodejs:mainfrom
inoway46:http-fix-pipelined-header-order
Open

inoway46 wants to merge 1 commit into
nodejs:mainfrom
inoway46:http-fix-pipelined-header-order

Conversation

@inoway46

@inoway46 inoway46 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

When the first body chunk is not a utf8 or latin1 string, _send() puts the header at the front of the output queue. If a pipelined response is still waiting for its socket and 100 Continue is already queued, the header is sent before it.

Using _writeRaw() for the final response header preserves the order of queued informational responses. Nothing else changes on the wire.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added http Issues and PRs related to the http subsystem. needs-ci PRs that need a full CI run. labels Dec 2, 2026
@inoway46
inoway46 marked this pull request as ready for review December 2, 2026 06:23
@inoway46
inoway46 force-pushed the http-fix-pipelined-header-order branch from 665a1c1 to 0f1e5dd Compare December 2, 2026 06:28
When the first body chunk was not a utf8 or latin1 string, the header
was put at the front of the output queue. If a pipelined response was
still waiting for its socket and an informational response such as
100 Continue had already been queued, the header was sent before it.

Append the header with _writeRaw() instead, as is already the case
for string chunks. This also removes the duplicated accounting of
the pending output size.

Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: Claude Code
@inoway46
inoway46 force-pushed the http-fix-pipelined-header-order branch from 0f1e5dd to 65d3924 Compare December 2, 2026 07:10
@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.58%. Comparing base (408fdc5) to head (65d3924).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67959      +/-   ##
==========================================
+ Coverage   90.57%   90.58%   +0.01%     
==========================================
  Files         802      802              
  Lines      286674   286857     +183     
  Branches    55378    55400      +22     
==========================================
+ Hits       259655   259853     +198     
+ Misses      17125    17093      -32     
- Partials     9894     9911      +17     
Files with missing lines Coverage Δ
lib/internal/http/outgoing.js 97.82% <100.00%> (-0.21%) ⬇️

... and 41 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

http Issues and PRs related to the http subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants