[ 
https://issues.apache.org/jira/browse/WICKET-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18055666#comment-18055666
 ] 

ASF subversion and git services commented on WICKET-7162:
---------------------------------------------------------

Commit a12f1ca56837e7cf986646b916cbd5b16ee1f590 in wicket's branch 
refs/heads/dependabot/maven/spring.version-7.0.3 from Anna Weber
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=a12f1ca568 ]

[WICKET-7173] JavaxWebSocketConfigurator: Add back null check for httpSession 
(#1356)

Changes for WICKET-7162 removed a null check, leading to another NPE when 
trying to add httpSession to the userProperties map

> avoid NPE when web socket upgrade request is done in a stateless context
> ------------------------------------------------------------------------
>
>                 Key: WICKET-7162
>                 URL: https://issues.apache.org/jira/browse/WICKET-7162
>             Project: Wicket
>          Issue Type: Improvement
>            Reporter: Ernesto Reinaldo Barreiro
>            Assignee: Ernesto Reinaldo Barreiro
>            Priority: Major
>             Fix For: 10.7.0
>
>
> JavaxUpgradeHttpRequest assumes there is a session. Thus, such a request will 
> fail when there is none.
>  
> {code:java}
> public JavaxUpgradeHttpRequest(final Session session, EndpointConfig 
> endpointConfig)
> {
>     Map<String, Object> userProperties = session.getUserProperties();
>     if (userProperties == null || userProperties.isEmpty())
>     {
>        // workaround for JBoss Wildfly 8.0.Final
>        userProperties = endpointConfig.getUserProperties();
>     }
>     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(); 
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to