Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(node/http): casing ignored in ServerResponse.hasHeader() #27105

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

marvinhagemeister
Copy link
Contributor

We didn't respect casing when checking if a HTTP header is present in Node's ServerResponse.hasHeader(). This lead to us returning incorrect results when the header was present. Koa assumed that the Content-Type header wasn't present when it actually was and defaulted to a different Content-Type value.

Fixes #27101

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marvinhagemeister marvinhagemeister merged commit 9bc36aa into main Nov 27, 2024
17 checks passed
@marvinhagemeister marvinhagemeister deleted the fix-node-headers branch November 27, 2024 16:56
bartlomieju pushed a commit that referenced this pull request Nov 28, 2024
We didn't respect casing when checking if a HTTP header is present in
Node's `ServerResponse.hasHeader()`. This lead to us returning incorrect
results when the header was present. Koa assumed that the `Content-Type`
header wasn't present when it actually was and defaulted to a different
`Content-Type` value.

Fixes #27101
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.

Node/npm compatibility issue using koa-static's serve
2 participants