Skip to content

fix(engine.io): emit initial_headers and headers events in uServer#5460

Open
erdinccurebal wants to merge 1 commit intosocketio:mainfrom
erdinccurebal:fix/userver-initial-headers-event
Open

fix(engine.io): emit initial_headers and headers events in uServer#5460
erdinccurebal wants to merge 1 commit intosocketio:mainfrom
erdinccurebal:fix/userver-initial-headers-event

Conversation

@erdinccurebal
Copy link

Summary

  • The uServer (uWebSockets.js integration) was missing initial_headers and headers event emissions during WebSocket upgrades
  • The regular Server emits these events via the ws library's headers event in init(), but uServer.init() was empty and handleUpgrade() never emitted them
  • Added the missing event emissions in uServer.handleUpgrade() before the upgrade response is sent, matching the behavior of the regular Server
  • Enabled the previously skipped tests for the uws engine (should emit a 'initial_headers' event (websocket) and should emit several 'headers' events per connection)

Fixes #5300

Test plan

  • npm run test:default — 189 passing, 2 pending
  • npm run test:uws — 173 passing, 18 pending (the 3 headers tests now pass instead of being skipped)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Socket.IO with uWebSockets: "initial_headers" event not being emitted

1 participant