Unwrap session before selecting stats counter

See gh-29375
This commit is contained in:
rstoyanchev
2023-02-08 18:09:49 +00:00
parent b9fe095f60
commit 5b67dea506

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,6 +47,7 @@ import org.springframework.web.socket.WebSocketMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator;
import org.springframework.web.socket.handler.SessionLimitExceededException;
import org.springframework.web.socket.handler.WebSocketSessionDecorator;
import org.springframework.web.socket.sockjs.transport.session.PollingSockJsSession;
import org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSession;
@@ -669,6 +670,7 @@ public class SubProtocolWebSocketHandler
}
AtomicInteger getCountFor(WebSocketSession session) {
session = WebSocketSessionDecorator.unwrap(session);
if (session instanceof PollingSockJsSession) {
return this.httpPolling;
}