Skip to content

Commit

Permalink
fix(connect): Handle redirect with "con" parameter for proxy requests
Browse files Browse the repository at this point in the history
When opening new connection tab from Hawtio on Spring Boot, we're
getting redirected without con parameter. This commit fixes this problem.

Fixes hawtio#3317

Signed-off-by: Grzegorz Grzybek <gr.grzybek@gmail.com>
  • Loading branch information
grgrzybek authored and tadayosi committed Apr 17, 2024
1 parent 19adffb commit 444ed91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public String forwardHawtioRequestToIndexHtml(HttpServletRequest request) {
final String path = endpointPath.resolve("hawtio");

if (request.getRequestURI().equals(path)) {
String query = request.getQueryString();
if (query != null && !query.isEmpty()) {
return "redirect:" + path + "/index.html?" + query;
}
return "redirect:" + path + "/index.html";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
return;
}

redirector.doRedirect(httpRequest, httpResponse, "/index.html");
String query = httpRequest.getQueryString();
if (query != null && !query.isEmpty()) {
redirector.doRedirect(httpRequest, httpResponse, "/index.html?" + query);
} else {
redirector.doRedirect(httpRequest, httpResponse, "/index.html");
}
}
}

0 comments on commit 444ed91

Please sign in to comment.