Skip to content

Commit

Permalink
fix: ensure connection header is a string (#1900)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag authored Feb 1, 2023
1 parent 055780a commit db0b5ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ function processHeader (request, key, val) {
key.length === 10 &&
key.toLowerCase() === 'connection'
) {
const value = val.toLowerCase()
const value = typeof val === 'string' ? val.toLowerCase() : null
if (value !== 'close' && value !== 'keep-alive') {
throw new InvalidArgumentError('invalid connection header')
} else if (value === 'close') {
Expand Down

0 comments on commit db0b5ca

Please sign in to comment.