You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2022/12/07 07:49:51 UTC

[GitHub] [knox] smolnar82 commented on a diff in pull request #638: KNOX-2809 - Fix dispatch ha-class for HDFSUI high available.

smolnar82 commented on code in PR #638:
URL: https://github.com/apache/knox/pull/638#discussion_r1041866727


##########
gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/HdfsUIHaDispatch.java:
##########
@@ -26,6 +30,26 @@ public HdfsUIHaDispatch() throws ServletException {
     super();
   }
 
+  @Override
+  public URI getDispatchUrl(final HttpServletRequest request) {
+    String decoded;
+
+    try {
+      decoded = URLDecoder.decode(request.getRequestURL().toString(), StandardCharsets.UTF_8.name() );
+    } catch (final Exception e) {
+      /* fall back in case of exception */
+      decoded = request.getRequestURL().toString();
+    }
+
+    final StringBuilder str = new StringBuilder(decoded);
+    final String query = request.getQueryString();
+    if ( query != null ) {
+      str.append('?');
+      str.append(query);
+    }
+    return URI.create(str.toString());
+  }
+

Review Comment:
   @Flamingo93 - any progress on this thread? Please address my above review comment so that we can continue merging this PR. Thanks!



-- 
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: dev-unsubscribe@knox.apache.org

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