You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When retrieving the cookie property from the socket's handshake headers, typescript's typing is giving the error Property 'cookie' does not exist on type 'object'.
To reproduce
Socket.IO server version: 3.1.0
Server
import{Server}from'socket.io';constio=newServer(3000,{});io.on('connection',(socket)=>{// Property 'cookie' does not exist on type 'object'console.log(socket.handshake.headers.cookie);// Okconsole.log((socket.handshake.headersasany).cookie);});
Expected behavior
We should be able to retrieve the cookie property without casting the headers to any.
A better typing could be Record<string, any>.
The text was updated successfully, but these errors were encountered:
Description
When retrieving the cookie property from the socket's handshake headers, typescript's typing is giving the error
Property 'cookie' does not exist on type 'object'
.To reproduce
Socket.IO server version:
3.1.0
Server
Expected behavior
We should be able to retrieve the cookie property without casting the headers to any.
A better typing could be
Record<string, any>
.The text was updated successfully, but these errors were encountered: