diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index d116cb9d5ee925..e7a0cbb436b1f5 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -11,7 +11,6 @@ const { ObjectPrototypeHasOwnProperty, ReflectApply, ReflectGetPrototypeOf, - StringPrototypeIncludes, StringPrototypeToLowerCase, StringPrototypeTrim, Symbol, @@ -82,9 +81,7 @@ let statusConnectionHeaderWarned = false; // close as possible to the current require('http') API const assertValidHeader = hideStackFrames((name, value) => { - if (name === '' || - typeof name !== 'string' || - StringPrototypeIncludes(name, ' ')) { + if (name === '' || typeof name !== 'string' || name.indexOf(' ') >= 0) { throw new ERR_INVALID_HTTP_TOKEN('Header name', name); } if (isPseudoHeader(name)) {