You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2019/05/28 18:56:01 UTC

[GitHub] [hbase] joshelser commented on a change in pull request #261: HBASE-22467 UI fixes to enable Knox proxying

joshelser commented on a change in pull request #261: HBASE-22467 UI fixes to enable Knox proxying
URL: https://github.com/apache/hbase/pull/261#discussion_r288253912
 
 

 ##########
 File path: hbase-http/src/main/java/org/apache/hadoop/hbase/http/ProfileOutputServlet.java
 ##########
 @@ -48,11 +51,25 @@ protected void doGet(final HttpServletRequest req, final HttpServletResponse res
     // will be <100 bytes (in all modes).
     if (requestedFile.length() < 100) {
       LOG.info(requestedFile  + " is incomplete. Sending auto-refresh header.");
-      resp.setHeader("Refresh", REFRESH_PERIOD + "," + req.getRequestURI());
+      String refreshUrl = req.getRequestURI();
+      // Rebuild the query string (if we have one)
+      if (req.getQueryString() != null) {
+        refreshUrl += "?" + sanitize(req.getQueryString());
+      }
+      ProfileServlet.setResponseHeader(resp);
+      resp.setHeader("Refresh", REFRESH_PERIOD + ";" + refreshUrl);
       resp.getWriter().write("This page will be auto-refreshed every " + REFRESH_PERIOD +
-        " seconds until the output file is ready.");
+        " seconds until the output file is ready. Redirecting to " + refreshUrl);
     } else {
       super.doGet(req, resp);
     }
   }
+
+  static String sanitize(String input) {
 
 Review comment:
   Nope! Just ignorant of that class. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services