You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by GitBox <gi...@apache.org> on 2021/08/12 19:33:42 UTC

[GitHub] [shiro] bdemers commented on a change in pull request #317: [SHIRO-678] only query parameters for sessionID if found

bdemers commented on a change in pull request #317:
URL: https://github.com/apache/shiro/pull/317#discussion_r688028609



##########
File path: web/src/main/java/org/apache/shiro/web/session/mgt/DefaultWebSessionManager.java
##########
@@ -130,13 +130,18 @@ private Serializable getReferencedSessionId(ServletRequest request, ServletRespo
             //try the URI path segment parameters first:
             id = getUriPathSegmentParamValue(request, ShiroHttpSession.DEFAULT_SESSION_ID_NAME);
 
-            if (id == null) {
+            if (id == null && request instanceof HttpServletRequest) {
                 //not a URI path segment parameter, try the query parameters:
                 String name = getSessionIdName();
-                id = request.getParameter(name);
-                if (id == null) {
-                    //try lowercase:
-                    id = request.getParameter(name.toLowerCase());
+                HttpServletRequest httpServletRequest = WebUtils.toHttp(request);
+                String queryString = httpServletRequest.getQueryString();
+                if (queryString.contains(name)

Review comment:
       check for an NPE ;)




-- 
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: commits-unsubscribe@shiro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org