fix(engine.io): emit initial_headers and headers events in uServer#5460
Open
erdinccurebal wants to merge 1 commit intosocketio:mainfrom
Open
fix(engine.io): emit initial_headers and headers events in uServer#5460erdinccurebal wants to merge 1 commit intosocketio:mainfrom
erdinccurebal wants to merge 1 commit intosocketio:mainfrom
Conversation
The uServer (uWebSockets.js) implementation did not emit "initial_headers" and "headers" events during WebSocket upgrades, unlike the regular Server which does this via the ws "headers" event. This adds the missing event emissions in uServer.handleUpgrade() and enables the previously skipped tests for the uws engine. Fixes: socketio#5300
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
uServer(uWebSockets.js integration) was missinginitial_headersandheadersevent emissions during WebSocket upgradesServeremits these events via thewslibrary'sheadersevent ininit(), butuServer.init()was empty andhandleUpgrade()never emitted themuServer.handleUpgrade()before the upgrade response is sent, matching the behavior of the regularServeruwsengine (should emit a 'initial_headers' event (websocket)andshould emit several 'headers' events per connection)Fixes #5300
Test plan
npm run test:default— 189 passing, 2 pendingnpm run test:uws— 173 passing, 18 pending (the 3 headers tests now pass instead of being skipped)