[jira] [Work logged] (KNOX-2809) HDFSUI is not high available
[ https://issues.apache.org/jira/browse/KNOX-2809?focusedWorklogId=835615=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-835615 ] ASF GitHub Bot logged work on KNOX-2809: Author: ASF GitHub Bot Created on: 25/Dec/22 13:38 Start Date: 25/Dec/22 13:38 Worklog Time Spent: 10m Work Description: Flamingo93 commented on code in PR #638: URL: https://github.com/apache/knox/pull/638#discussion_r1056955169 ## 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: @smolnar82 sorry for late. I create a util class for dispatch url processing as your recommendation. Thanks for your recommendation and patience. Issue Time Tracking --- Worklog Id: (was: 835615) Time Spent: 1h 10m (was: 1h) > HDFSUI is not high available > > > Key: KNOX-2809 > URL: https://issues.apache.org/jira/browse/KNOX-2809 > Project: Apache Knox > Issue Type: Bug > Components: Server >Affects Versions: 1.5.0, 1.6.0 >Reporter: Chang Zhichao >Priority: Major > Fix For: 1.6.0 > > Time Spent: 1h 10m > Remaining Estimate: 0h > > HDFSUI use org.apache.knox.gateway.dispatch.URLDecodingDispatch for request, > it didn't do failoverRequest when executeRequest failed. >  -- This message was sent by Atlassian Jira (v8.20.10#820010)
[GitHub] [knox] Flamingo93 commented on a diff in pull request #638: KNOX-2809 - Fix dispatch ha-class for HDFSUI high available.
Flamingo93 commented on code in PR #638: URL: https://github.com/apache/knox/pull/638#discussion_r1056955169 ## 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: @smolnar82 sorry for late. I create a util class for dispatch url processing as your recommendation. Thanks for your recommendation and patience. -- 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-unsubscr...@knox.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org