fix(proxy-agent): preserve repeated iterable headers - #5779
Open
GiHoon1123 wants to merge 1 commit into
Open
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsnpx eslint lib/dispatcher/proxy-agent.js test/proxy-agent.js