From 300a0439b2a6e26d9025247ef780c886616d4ae1 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 16 Dec 2016 15:41:14 +0300 Subject: CharEncoding.UTF_8 --- juick-ws/src/main/java/com/juick/ws/WebsocketComponent.java | 3 ++- .../src/main/java/com/juick/ws/configuration/WebsocketInitializer.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'juick-ws/src/main/java/com/juick/ws') diff --git a/juick-ws/src/main/java/com/juick/ws/WebsocketComponent.java b/juick-ws/src/main/java/com/juick/ws/WebsocketComponent.java index 85f936b5..c73c50e5 100644 --- a/juick-ws/src/main/java/com/juick/ws/WebsocketComponent.java +++ b/juick-ws/src/main/java/com/juick/ws/WebsocketComponent.java @@ -3,6 +3,7 @@ package com.juick.ws; import com.juick.User; import com.juick.service.MessagesService; import com.juick.service.UserService; +import org.apache.commons.lang3.CharEncoding; import org.apache.commons.lang3.math.NumberUtils; import org.apache.http.NameValuePair; import org.apache.http.client.utils.URLEncodedUtils; @@ -45,7 +46,7 @@ public class WebsocketComponent extends TextWebSocketHandler { // Auth User visitor = new User(); - List params = URLEncodedUtils.parse(hLocation, "UTF-8"); + List params = URLEncodedUtils.parse(hLocation, CharEncoding.UTF_8); for (NameValuePair param : params) { if (param.getName().equals("hash")) { String hash = param.getValue(); diff --git a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java index 6feea4c7..ed6b1069 100644 --- a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java +++ b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java @@ -1,6 +1,7 @@ package com.juick.ws.configuration; import com.juick.configuration.DataConfiguration; +import org.apache.commons.lang3.CharEncoding; import org.springframework.web.filter.CharacterEncodingFilter; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; @@ -28,7 +29,7 @@ public class WebsocketInitializer extends AbstractAnnotationConfigDispatcherServ @Override protected Filter[] getServletFilters() { - return new Filter[]{new CharacterEncodingFilter("UTF-8")}; + return new Filter[]{new CharacterEncodingFilter(CharEncoding.UTF_8)}; } @Override -- cgit v1.2.3