zwangsheng commented on code in PR #4983:
URL: https://github.com/apache/kyuubi/pull/4983#discussion_r1236418792


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/EngineUIProxyServlet.scala:
##########
@@ -30,14 +30,15 @@ private[api] class EngineUIProxyServlet extends 
ProxyServlet with Logging {
   override def rewriteTarget(request: HttpServletRequest): String = {
     val requestURL = request.getRequestURL
     val requestURI = request.getRequestURI
+    val queryString = getQueryString(request)
     var targetURL = "/no-ui-error"
     extractTargetAddress(requestURI).foreach { case (host, port) =>
       val targetURI = requestURI.stripPrefix(s"/engine-ui/$host:$port") match {
         // for some reason, the proxy can not handle redirect well, as a 
workaround,
         // we simulate the Spark UI redirection behavior and forcibly rewrite 
the
         // empty URI to the Spark Jobs page.
         case "" | "/" => "/jobs/"
-        case path => path
+        case path => path + queryString

Review Comment:
   We can move those `append logic` out. Like:
   ``` scala
   val targetURI = requestURI.stripPrefix(s"/engine-ui/$host:$port") match {
       case "" | "/" => "/jobs/" 
       case path => path
   } + queryString
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to