Skip to content

Commit

Permalink
Issue #499
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrojdeCTL committed Sep 11, 2018
1 parent 253114b commit eea14c8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mdw-hub/src/com/centurylink/mdw/hub/servlet/AccessFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,19 @@ else if (internalRequest) {
}
}

// This is to remove the JWT from QueryString
// This is to remove the JWT from QueryString - but preserve path and rest of query string
if ((user != null || authUser != null) && "GET".equals(request.getMethod()) && request.getParameter(Listener.AUTHORIZATION_HEADER_NAME) != null) {
response.sendRedirect(ApplicationContext.getMdwHubUrl() + "/");
String query = "";
if (request.getParameterMap().size() > 1) {
int startIdx = 0;
int endIdx = request.getQueryString().toLowerCase().indexOf("authorization=");
int startIdx2 = request.getQueryString().indexOf("&", endIdx)+1;
query += "?";
query += startIdx < endIdx ? request.getQueryString().substring(startIdx, endIdx-1) : "";
query += startIdx2 > 0 ? query.length() > 1 ? "&" + request.getQueryString().substring(startIdx2) : request.getQueryString().substring(startIdx2) : "";
}
String url = ApplicationContext.getMdwHubUrl() + (path.length() == 0 ? "/" : path) + query;
response.sendRedirect(url);
return;
}

Expand Down

0 comments on commit eea14c8

Please sign in to comment.