lmccay commented on a change in pull request #476:
URL: https://github.com/apache/knox/pull/476#discussion_r697741396



##########
File path: 
gateway-applications/src/main/resources/applications/knoxauth/app/logout.jsp
##########
@@ -62,15 +75,41 @@
                 whitelist = "";
             }
         }
+
+        boolean validRedirect = false;
         String origUrl = request.getParameter("originalUrl");
         String del = "?";
-        if (origUrl.contains("?")) {
+        if (origUrl != null && origUrl.contains("?")) {
           del = "&";
         }
-        boolean validRedirect = RegExUtils.checkWhitelist(whitelist, origUrl);
-        if (("1".equals(request.getParameter("returnToApp"))) && 
validRedirect) {
-          response.setStatus(response.SC_MOVED_PERMANENTLY);
-          response.setHeader("Location",originalUrl + del + "refresh=1");
+        if (origUrl != null) {
+          validRedirect = RegExUtils.checkWhitelist(whitelist, origUrl);
+        }
+        if (("1".equals(request.getParameter("returnToApp")))) {
+          if (validRedirect) {
+               response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
+               response.setHeader("Location",originalUrl + del + "refresh=1");
+            return;
+          }
+        }
+               else if (("1".equals(request.getParameter("globalLogout")))) {

Review comment:
       I'll fix that. New eclipse project to fix some things and the indents 
were wrong. Had to manually adjust. Missed that.




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