We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c7180a commit a38ad07Copy full SHA for a38ad07
lib/internal/http2/compat.js
@@ -11,6 +11,7 @@ const {
11
ObjectPrototypeHasOwnProperty,
12
ReflectApply,
13
ReflectGetPrototypeOf,
14
+ StringPrototypeIncludes,
15
StringPrototypeToLowerCase,
16
StringPrototypeTrim,
17
Symbol,
@@ -81,7 +82,9 @@ let statusConnectionHeaderWarned = false;
81
82
// close as possible to the current require('http') API
83
84
const assertValidHeader = hideStackFrames((name, value) => {
- if (name === '' || typeof name !== 'string' || name.indexOf(' ') >= 0) {
85
+ if (name === '' ||
86
+ typeof name !== 'string' ||
87
+ StringPrototypeIncludes(name, ' ')) {
88
throw new ERR_INVALID_HTTP_TOKEN('Header name', name);
89
}
90
if (isPseudoHeader(name)) {
0 commit comments