Bug 1687021: Allow connection header names to be case insensitive. r=remote-protocol-reviewers,whimboo

Some client bindings will send over the headers with either a capital
first letter and some might not. We need to handle all cases

Differential Revision: https://phabricator.services.mozilla.com/D103384
This commit is contained in:
David Burns 2021-01-29 08:17:38 +00:00
parent 74b40cd436
commit 3cc69b8cc4

View File

@ -93,8 +93,8 @@ function processRequest({ requestLine, headers }) {
!connection ||
!connection
.split(",")
.map(t => t.trim())
.includes("Upgrade")
.map(t => t.trim().toLowerCase())
.includes("upgrade")
) {
throw new Error("The handshake request has incorrect Connection header");
}