Unwrap session before selecting stats counter

See gh-29375
This commit is contained in:
rstoyanchev 2023-02-08 18:09:49 +00:00
parent e5ff54955f
commit a7ec6b4a2a
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 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;
}