mirror of https://github.com/apache/nifi.git
NIFI-13695 Fixed Redirect Handling for Custom UI Extensions
Appending a trailing slash when opening a custom UI and in the query string to fragment filter to avoid a Jetty-based redirect that could lead to losing the proxy path. This closes #9222 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
2951eef8a5
commit
31a3014696
|
@ -40,7 +40,8 @@ public class QueryStringToFragmentFilter implements Filter {
|
|||
// Some NiFi front ends use hash based routing, so they don't need to know the baseHref. With hash based
|
||||
// routing query parameters are implemented within the URL fragment. Because of this any query parameters on the
|
||||
// original URL are not considered. This filter captures those and adds them to the fragment.
|
||||
final RequestUriBuilder requestUriBuilder = RequestUriBuilder.fromHttpServletRequest(httpServletRequest).path(httpServletRequest.getContextPath()).fragment("/?" + queryString);
|
||||
final String contextPath = httpServletRequest.getContextPath() + "/";
|
||||
final RequestUriBuilder requestUriBuilder = RequestUriBuilder.fromHttpServletRequest(httpServletRequest).path(contextPath).fragment("/?" + queryString);
|
||||
final URI redirectUri = requestUriBuilder.build();
|
||||
|
||||
final HttpServletResponse httpServletResponse = (HttpServletResponse) response;
|
||||
|
|
|
@ -81,7 +81,7 @@ export class AdvancedUi {
|
|||
.set('editable', params.editable)
|
||||
.set('disconnectedNodeAcknowledged', params.disconnectedNodeAcknowledged)
|
||||
.toString();
|
||||
const url = `${params.url}?${queryParams}`;
|
||||
const url = `${params.url}/?${queryParams}`;
|
||||
|
||||
const sanitizedUrl = this.domSanitizer.sanitize(SecurityContext.URL, url);
|
||||
|
||||
|
|
Loading…
Reference in New Issue