Nflrijal commented on code in PR #59089:
URL: https://github.com/apache/spark/pull/59089#discussion_r4435150109
##########
core/src/main/scala/org/apache/spark/ui/JettyUtils.scala:
##########
@@ -294,7 +297,14 @@ private[spark] object JettyUtils extends Logging {
}
val existingContext =
Option(clientRequest.getHeader("X-Forwarded-Context")).getOrElse("")
val contextPath = Option(clientRequest.getContextPath).getOrElse("")
- val proxyContext = existingContext + contextPath + prefix
+ val proxyPrefix = if
(normalizedReverseProxyUrl.startsWith("http://") ||
+ normalizedReverseProxyUrl.startsWith("https://")) {
+ val uri = new java.net.URI(normalizedReverseProxyUrl)
+ Option(uri.getPath).getOrElse("")
+ } else {
+ normalizedReverseProxyUrl
+ }
+ val proxyContext = existingContext + proxyPrefix + contextPath +
prefix
Review Comment:
`reverseProxyPath` is now computed once in `createProxyHandler` from
`URI.getRawPath`, and `addProxyHeaders` uses the incoming `X-Forwarded-Context`
header when present instead of prepending `reverseProxyPath` a second time.
--
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]