reiern70 commented on code in PR #1223:
URL: https://github.com/apache/wicket/pull/1223#discussion_r2270314825


##########
wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/WicketServerEndpointConfig.java:
##########
@@ -127,18 +128,33 @@ public void modifyHandshake(ServerEndpointConfig sec, 
HandshakeRequest request,
                        // do not store null keys/values because Tomcat 8 uses 
ConcurrentMap for UserProperties
 
                        Map<String, Object> userProperties = 
sec.getUserProperties();
+
+                       URI requestURI = request.getRequestURI();
+                       LOG.trace("requestURI: {}", requestURI);
+                       if (requestURI != null)
+                       {
+                               userProperties.put("requestURI", requestURI);
+                               String path = requestURI.getPath();
+                               if (path != null && path.indexOf("/wicket") > 
0) {
+                                       String contextPath = path.substring(0, 
path.indexOf("/wicket"));
+                                       
userProperties.put(JavaxUpgradeHttpRequest.CONTEXT_PATH, contextPath);
+                               }
+                       }
+
                        Object httpSession = request.getHttpSession();
                        LOG.trace("httpSession: {}", httpSession);
-                       if (httpSession != null)
+                       userProperties.put(JavaxUpgradeHttpRequest.SESSION, 
httpSession);
+                       if (httpSession instanceof HttpSession)
                        {
-                               userProperties.put("session", httpSession);
+                               
userProperties.put(JavaxUpgradeHttpRequest.CONTEXT_PATH,((HttpSession)httpSession).getServletContext().getContextPath());

Review Comment:
   Adding this for "backwards compatibility"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to