Skip to content

fix: correctly handle multi-value rawHeaders in fetch#4938

Merged
mcollina merged 2 commits intomainfrom
fix/issue-4389
Apr 1, 2026
Merged

fix: correctly handle multi-value rawHeaders in fetch#4938
mcollina merged 2 commits intomainfrom
fix/issue-4389

Conversation

@mcollina
Copy link
Copy Markdown
Member

Fixes #4389. When an interceptor is used, rawHeaders can contain arrays for multi-value headers like Set-Cookie. This fix ensures each value is appended individually to the HeadersList.

When an interceptor is used, rawHeaders can contain arrays for multi-value headers like Set-Cookie. This fix ensures that when a header value is an array (but not a Buffer), each value is appended individually to the HeadersList instead of being converted to a string and concatenated.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.93%. Comparing base (5145a7c) to head (f3fcb85).

Files with missing lines Patch % Lines
lib/web/fetch/index.js 83.33% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4938      +/-   ##
==========================================
- Coverage   92.93%   92.93%   -0.01%     
==========================================
  Files         112      112              
  Lines       35709    35725      +16     
==========================================
+ Hits        33187    33201      +14     
- Misses       2522     2524       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@mcollina mcollina merged commit 6acd19b into main Apr 1, 2026
35 of 37 checks passed
@mcollina mcollina deleted the fix/issue-4389 branch April 1, 2026 09:28
@github-actions github-actions bot mentioned this pull request Apr 1, 2026
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.

Set-Cookie header gets concatenated in fetch if an interceptor is in place

3 participants