diff --git a/engine.io-server/src/main/java/io/socket/engineio/server/EngineIoServer.java b/engine.io-server/src/main/java/io/socket/engineio/server/EngineIoServer.java index 5994d6c..fb61182 100644 --- a/engine.io-server/src/main/java/io/socket/engineio/server/EngineIoServer.java +++ b/engine.io-server/src/main/java/io/socket/engineio/server/EngineIoServer.java @@ -186,6 +186,7 @@ private void handshakePolling(HttpServletRequest request, HttpServletResponse re final Transport transport = new Polling(lockObject); socket.init(transport, request); transport.onRequest(request, response); + socket.updateInitialHeadersFromActiveTransport(); mClients.put(sid, socket); socket.once("close", args -> mClients.remove(sid)); diff --git a/engine.io-server/src/main/java/io/socket/engineio/server/EngineIoSocket.java b/engine.io-server/src/main/java/io/socket/engineio/server/EngineIoSocket.java index d2a9ec0..58b2ee7 100644 --- a/engine.io-server/src/main/java/io/socket/engineio/server/EngineIoSocket.java +++ b/engine.io-server/src/main/java/io/socket/engineio/server/EngineIoSocket.java @@ -133,6 +133,11 @@ void init(Transport transport, @SuppressWarnings("unused") HttpServletRequest in onOpen(); } + void updateInitialHeadersFromActiveTransport() { + mInitialQuery = mTransport.getInitialQuery(); + mInitialHeaders = mTransport.getInitialHeaders(); + } + /** * Handle an HTTP request. *