Repository navigation
fix: preserve repeated header values when merging with defaults - #667
abdul-karim-mia wants to merge 1 commit into
Conversation
Signed-off-by: Abdul karim mia <akmia51@gmail.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
🔗 Linked issue
Closes #655
❓ Type of change
📚 Description
Previously, when
defaults.headerswas configured,mergeHeadersiterated directly over iterable/tupleinputheaders and calledheaders.set(key, value)on each entry. For tuple arrays or other iterables containing repeated header names (such as[["Accept", "application/json"], ["Accept", "text/plain"]]), eachsetoverwrote earlier values for the same header instead of combining them viaHeaders.This updates
mergeHeadersinsrc/utils.tsto normalizeinputwithnew Headers(input)first and clear-then-append each unique header name on the mergedHeadersobject, preserving combined repeated values and multi-valueSet-Cookieheaders while still allowing request headers to override matching defaults.📝 Checklist
test/index.test.ts).Summary by CodeRabbit
AcceptandSet-Cookievalues.