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


##########
wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/JavaxUpgradeHttpRequest.java:
##########
@@ -75,14 +81,21 @@ public JavaxUpgradeHttpRequest(final Session session, 
EndpointConfig endpointCon
                        userProperties = endpointConfig.getUserProperties();
                }
 
-               this.httpSession = (HttpSession) userProperties.get("session");
-               this.headers = (Map<String, List<String>>) 
userProperties.get("headers");
+               this.httpSession = (HttpSession) userProperties.get(SESSION);
+               this.headers = (Map<String, List<String>>) 
userProperties.get(HEADERS);
                this.queryString = session.getQueryString();
                this.userPrincipal = session.getUserPrincipal();
                Object requestURI = session.getRequestURI();
                this.requestUri = requestURI != null ? requestURI.toString() : 
"";
-               this.contextPath = 
httpSession.getServletContext().getContextPath();
-
+               if (httpSession == null)
+               {
+                       this.contextPath = "/";

Review Comment:
   @martin-g I'm not sure this is correct or if this path is used anywhere 
else.. I was looking into code base and didn't see any other object from where 
we could take the path. We are getting this NPE from time to time on our test 
severs... 



-- 
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