Skip to content

fix(fetch): use case-insensitive host header lookup on redirect#41769

Open
rahulrao85 wants to merge 1 commit into
microsoft:mainfrom
rahulrao85:fix-41766
Open

fix(fetch): use case-insensitive host header lookup on redirect#41769
rahulrao85 wants to merge 1 commit into
microsoft:mainfrom
rahulrao85:fix-41766

Conversation

@rahulrao85

Copy link
Copy Markdown

Summary

The redirect host header update used \headers['host']\ (lowercase only), but \setHeader()\ preserves the original casing of header names. If \extraHTTPHeaders\ set 'Host'\ (capital H), the host was never updated on redirect, causing the request to be sent with the original origin's Host header.

Now uses case-insensitive lookup (\Object.keys().find()), consistent with \setHeader, \getHeader, and
emoveHeader\ in the same file.

Fixes: #41766

The redirect host header update used headers['host'] (lowercase only), but setHeader() preserves the original casing of header names. If extraHTTPHeaders set 'Host' (capital H), the redirect's host update was silently skipped.

Now uses case-insensitive lookup like setHeader, getHeader, and removeHeader in the same file.

Fixes: microsoft#41766
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.

Case-sensitive host header lookup in fetch redirect breaks cross-origin requests with custom headers

1 participant