Skip to content

Fix crash when the Upgrade header cannot be read#2231

Merged
lpinca merged 1 commit into
masterfrom
fix/issue-2230
Jun 16, 2024
Merged

Fix crash when the Upgrade header cannot be read#2231
lpinca merged 1 commit into
masterfrom
fix/issue-2230

Conversation

@lpinca
Copy link
Copy Markdown
Member

@lpinca lpinca commented Jun 15, 2024

It is possible that the Upgrade header is correctly received and handled
(the 'upgrade' event is emitted) without its value being returned to
the user. This can happen if the number of received headers exceed the
server.maxHeadersCount or request.maxHeadersCount threshold. In this
case incomingMessage.headers.upgrade may not be set.

Handle the case correctly and abort the handshake.

Fixes #2230

Loading
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.

Throws TypeError when there are too many HTTP headers

2 participants