Skip to content

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

Merged
marvinhagemeister merged 1 commit into
mainfrom
fix-node-headers
Nov 27, 2024
Merged

fix(node/http): casing ignored in ServerResponse.hasHeader()#27105
marvinhagemeister merged 1 commit into
mainfrom
fix-node-headers

Conversation

@marvinhagemeister
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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
@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