aboutsummaryrefslogtreecommitdiff
path: root/juick-notifications/src/main/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-09-20 17:48:54 +0300
committerGravatar Vitaly Takmazov2018-09-20 17:48:54 +0300
commitb1c9ab2d9ccd6d5dcffabe2d5c4bca42563e2d3e (patch)
tree51a3b3240d507c2acf20ececffbfd30e283505fe /juick-notifications/src/main/java
parentddab0db7c0a44af5921289af7e90f7325f1cdf69 (diff)
do not handle messages from invalid websocket sessions
Diffstat (limited to 'juick-notifications/src/main/java')
-rw-r--r--juick-notifications/src/main/java/com/juick/components/Notifications.java2
-rw-r--r--juick-notifications/src/main/java/com/juick/components/configuration/JuickServerWebsocketConfiguration.java1
2 files changed, 1 insertions, 2 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/Notifications.java b/juick-notifications/src/main/java/com/juick/components/Notifications.java
index 15af4a52..79afe8fa 100644
--- a/juick-notifications/src/main/java/com/juick/components/Notifications.java
+++ b/juick-notifications/src/main/java/com/juick/components/Notifications.java
@@ -321,7 +321,7 @@ public class Notifications extends TextWebSocketHandler implements NotificationC
@Override
protected void handleTextMessage(WebSocketSession session, TextMessage text) throws Exception {
- if (!closeFlag.get()) {
+ if (!closeFlag.get() && this.session.getDelegate().equals(session)) {
com.juick.Message jmsg = jsonMapper.readValue(text.asBytes(), com.juick.Message.class);
if (logger.isInfoEnabled()) // prevent writeValueAsString execution if logger disabled
diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/JuickServerWebsocketConfiguration.java b/juick-notifications/src/main/java/com/juick/components/configuration/JuickServerWebsocketConfiguration.java
index a29566aa..bc7f59fb 100644
--- a/juick-notifications/src/main/java/com/juick/components/configuration/JuickServerWebsocketConfiguration.java
+++ b/juick-notifications/src/main/java/com/juick/components/configuration/JuickServerWebsocketConfiguration.java
@@ -25,7 +25,6 @@ import javax.inject.Inject;
import java.util.Collections;
import java.util.List;
-@Lazy
@Configuration
@EnableScheduling
public class JuickServerWebsocketConfiguration {