feat(node): implement HTTP/2 settings API (getDefaultSettings, getPackedSettings, getUnpackedSettings)#32275
Open
dive2tech wants to merge 1 commit intodenoland:mainfrom
Open
Conversation
042e4fc to
4cc3648
Compare
…kedSettings, getUnpackedSettings) Co-authored-by: Cursor <cursoragent@cursor.com>
6c9be96 to
981536b
Compare
Member
|
Thanks for the PR, but there's little chance we will merge it. We are already working on Next time, please open an issue first to discuss if someone else has already tackled this work. |
Author
|
Hi @bartlomieju, I’ve added the HTTP/2 settings. If everything looks good, feel free to merge it, or let me know if I should close it. Thanks! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the Node.js-compatible HTTP/2 settings API for
node:http2:http2.getDefaultSettings()– Returns default HTTP/2 settings (RFC 7540 + Node.js defaults).http2.getPackedSettings(settings)– Packs a settings object into aBufferfor theHTTP2-Settingsheader (6 bytes per setting: 16-bit ID + 32-bit value, big-endian).http2.getUnpackedSettings(buffer)– Unpacks aBufferorTypedArrayof packed settings into an object.Changes
ext/node/polyfills/internal/http2/settings.ts– Encoding/decoding and validation per RFC 7540; supports known settings (headerTableSize, enablePush, maxConcurrentStreams, initialWindowSize, maxFrameSize, maxHeaderListSize, enableConnectProtocol) and numeric IDs for unknown settings.ext/node/polyfills/http2.ts– ReplacesnotImplementedstubs with the new implementation.tools/core_import_map.json– Registers the new internal settings module.tests/unit_node/http2_settings_test.ts– Tests for defaults, roundtrip, validation (enablePush 0/1, maxFrameSize bounds, initialWindowSize max, etc.), invalid inputs, and packed format.Compatibility