Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Feb 1, 2023
1 parent db9e49c commit ce3d4ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/core/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,12 @@ class Request {
}

function processHeaderValue (key, val) {
if (typeof val !== 'string' && headerCharRegex.exec(val) !== null) {
if (val && (typeof val === 'object' && !Array.isArray(val))) {
throw new InvalidArgumentError(`invalid ${key} header`)
} else if (headerCharRegex.exec(val) !== null) {
throw new InvalidArgumentError(`invalid ${key} header`)
}

return `${key}: ${val}\r\n`
}

Expand Down

0 comments on commit ce3d4ce

Please sign in to comment.