From 1b384329ae63bb7d98d66352246bf2b3d79a30b5 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 5 Apr 2019 17:50:41 +0200 Subject: [PATCH] Fixes #3526 - Request locale not retained in WebsocketUpgrade request. Trivial fix, the locale was not copied from the HTTP requets to the WebSocket upgrade request. Signed-off-by: Simone Bordet --- .../jetty/websocket/servlet/UpgradeHttpServletRequest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/UpgradeHttpServletRequest.java b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/UpgradeHttpServletRequest.java index dbd0d1c5347..e454eba259e 100644 --- a/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/UpgradeHttpServletRequest.java +++ b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/UpgradeHttpServletRequest.java @@ -123,6 +123,12 @@ public class UpgradeHttpServletRequest implements HttpServletRequest attributes.put(name, httpRequest.getAttribute(name)); } + Enumeration localeElements = httpRequest.getLocales(); + while (localeElements.hasMoreElements()) + { + locales.add(localeElements.nextElement()); + } + localAddress = InetSocketAddress.createUnresolved(httpRequest.getLocalAddr(), httpRequest.getLocalPort()); localName = httpRequest.getLocalName(); remoteAddress = InetSocketAddress.createUnresolved(httpRequest.getRemoteAddr(), httpRequest.getRemotePort());