forked from request/request
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed version label from h2 to http2 for more verbosity
- Loading branch information
1 parent
fffca4f
commit 0d9d4bc
Showing
12 changed files
with
70 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
const {constants} = require('http2') | ||
/* | ||
* The following code has been borrowed from the Node.js project | ||
* v20.15.0 /Users/[email protected]/node/lib/internal/http2/compat.js | ||
*/ | ||
const {constants = {}} = require('http2') | ||
|
||
const kValidPseudoHeaders = new Set([ | ||
constants.HTTP2_HEADER_STATUS, | ||
constants.HTTP2_HEADER_METHOD, | ||
constants.HTTP2_HEADER_AUTHORITY, | ||
constants.HTTP2_HEADER_SCHEME, | ||
constants.HTTP2_HEADER_PATH | ||
]) | ||
|
||
function assertValidPseudoHeader (header) { | ||
const kValidPseudoHeaders = new Set([ | ||
constants.HTTP2_HEADER_STATUS, | ||
constants.HTTP2_HEADER_METHOD, | ||
constants.HTTP2_HEADER_AUTHORITY, | ||
constants.HTTP2_HEADER_SCHEME, | ||
constants.HTTP2_HEADER_PATH | ||
]) | ||
if (!kValidPseudoHeaders.has(header)) { | ||
throw new Error('Invalid PseudoHeader ' + header) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.