Backport WebSocket maxPayloadSize fixes to v7.x#5423
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v7.x #5423 +/- ##
==========================================
+ Coverage 93.01% 93.10% +0.08%
==========================================
Files 112 112
Lines 35983 36018 +35
==========================================
+ Hits 33471 33535 +64
+ Misses 2512 2483 -29 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
a708dc8 to
a6824f7
Compare
(cherry picked from commit bd91f86) Signed-off-by: Matteo Collina <hello@matteocollina.com>
(cherry picked from commit 9d82667) Signed-off-by: Matteo Collina <hello@matteocollina.com>
Account for previously received fragment bytes when checking WebSocket payload size limits, so fragmented messages cannot exceed maxPayloadSize by splitting the payload across frames. Add coverage for cumulative fragmented payload size enforcement. Co-authored-by: Matthew Aitken <maitken033380023@gmail.com> (cherry picked from commit b4c287b) Signed-off-by: Matteo Collina <hello@matteocollina.com>
a6824f7 to
b4eb7db
Compare
Treat zero-byte frames as real fragments so fragmented messages can start with an empty frame and empty continuations still count toward maxFragments. Pass dispatcher WebSocket limits through to WebSocketStream's parser, add regression coverage for WebSocket and WebSocketStream fragment limits, make the fragment close tests wait for both endpoints, and fix the Client docs typo for maxFragments. Co-authored-by: Ulises Gascon <ulisesgascongonzalez@gmail.com> (cherry picked from commit c5ed787) Signed-off-by: Matteo Collina <hello@matteocollina.com>
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.
This relates to...
Backporting WebSocket
maxPayloadSizesupport and follow-up fixes frommaintov7.x.Backported commits:
Related
maincommit32dbf0b3is not included becausev7.xalready contains the equivalent fragment-limit backport as8cb10f98.Rationale
Keeps the v7 release line aligned with
mainfor configurable WebSocket payload limits, including enforcement across fragmented messages and WebSocketStream parser limits.Changes
Features
webSocket.maxPayloadSizesupport with a 128 MB default and0to disable.webSocket.maxFragmentsoption while integrating the new payload limit.Bug Fixes
maxFragments.main.Breaking Changes and Deprecations
N/A
Status
Tests:
npm run test:typescriptnode --test test/websocket/fragments.js test/websocket/stream/too-many-fragments.js test/websocket/permessage-deflate-limit.js test/websocket/permessage-deflate-config.jsnpm run lint