Skip to content

fix(proxy-agent): preserve repeated iterable headers - #5779

Open
GiHoon1123 wants to merge 1 commit into
nodejs:mainfrom
GiHoon1123:fix-proxy-agent-iterable-headers
Open

fix(proxy-agent): preserve repeated iterable headers#5779
GiHoon1123 wants to merge 1 commit into
nodejs:mainfrom
GiHoon1123:fix-proxy-agent-iterable-headers

Conversation

@GiHoon1123

@GiHoon1123 GiHoon1123 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #5758.

ProxyAgent converts iterable request headers to an object before checking for Proxy-Authorization. If the iterable contains the same header more than once, the conversion keeps only the last value.

Keep repeated values when building the headers used by the proxy request, and add a regression test for the case.

Tests:

  • npx borp --timeout 180000 test/proxy-agent.js
  • npx eslint lib/dispatcher/proxy-agent.js test/proxy-agent.js

ProxyAgent materializes iterable request headers before checking for Proxy-Authorization. Repeated entries were collapsed when converted to an object, so only the last value reached the origin. Preserve repeated values and add regression coverage.

Signed-off-by: GiHoon1123 <rlaejrqo465@naver.com>
@codecov-commenter

codecov-commenter commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.51%. Comparing base (b73952a) to head (b7026b5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5779      +/-   ##
==========================================
- Coverage   93.51%   93.51%   -0.01%     
==========================================
  Files         110      110              
  Lines       39359    39372      +13     
==========================================
+ Hits        36808    36820      +12     
- Misses       2551     2552       +1     

☔ View full report in Codecov by Harness.
📢 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.

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.

2 participants