dongjoon-hyun commented on code in PR #45500:
URL: https://github.com/apache/spark/pull/45500#discussion_r1523607793
##########
core/src/main/scala/org/apache/spark/ui/JettyUtils.scala:
##########
@@ -588,36 +590,37 @@ private[spark] case class ServerInfo(
* a servlet context without the trailing slash (e.g. "/jobs") - Jetty will
send a redirect to the
* same URL, but with a trailing slash.
*/
-private class ProxyRedirectHandler(_proxyUri: String) extends HandlerWrapper {
+private class ProxyRedirectHandler(_proxyUri: String) extends Handler.Wrapper {
private val proxyUri = _proxyUri.stripSuffix("/")
override def handle(
- target: String,
- baseRequest: Request,
- request: HttpServletRequest,
- response: HttpServletResponse): Unit = {
- super.handle(target, baseRequest, request, new ResponseWrapper(request,
response))
- }
-
- private class ResponseWrapper(
- req: HttpServletRequest,
- res: HttpServletResponse)
- extends HttpServletResponseWrapper(res) {
-
- override def sendRedirect(location: String): Unit = {
- val newTarget = if (location != null) {
- val target = new URI(location)
- // The target path should already be encoded, so don't re-encode it,
just the
- // proxy address part.
- val proxyBase = UIUtils.uiRoot(req)
- val proxyPrefix = if (proxyBase.nonEmpty) s"$proxyUri$proxyBase" else
proxyUri
- s"${res.encodeURL(proxyPrefix)}${target.getPath()}"
- } else {
- null
- }
- super.sendRedirect(newTarget)
- }
+ request: Request,
+ response: org.eclipse.jetty.server.Response,
+ callback: Callback): Boolean = {
+ // Todo: Fix the proxy redirect behaviour.
+// super.handle(request, new ResponseWrapper(request, response), callback)
+ super.handle(request, response, callback)
}
+//
+// private class ResponseWrapper(
+// req: Request,
+// res: Response)
+// extends Response.Wrapper(req, res) {
+//
+// override def sendRedirect(location: String): Unit = {
+// val newTarget = if (location != null) {
+// val target = new URI(location)
+// // The target path should already be encoded, so don't re-encode it,
just the
+// // proxy address part.
+// val proxyBase = UIUtils.uiRoot(req)
+// val proxyPrefix = if (proxyBase.nonEmpty) s"$proxyUri$proxyBase"
else proxyUri
+// s"${res.encodeURL(proxyPrefix)}${target.getPath()}"
+// } else {
+// null
+// }
+// super.sendRedirect(newTarget)
+// }
+// }
Review Comment:
Please remove this leftover.
--
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]