Github user ajbozarth commented on a diff in the pull request:
https://github.com/apache/spark/pull/17455#discussion_r109505880
--- Diff: core/src/main/scala/org/apache/spark/deploy/master/Master.scala
---
@@ -132,7 +132,13 @@ private[deploy] class Master(
webUi.bind()
masterWebUiUrl = "http://" + masterPublicAddress + ":" +
webUi.boundPort
if (reverseProxy) {
- masterWebUiUrl = conf.get("spark.ui.reverseProxyUrl", masterWebUiUrl)
+ conf.getOption("spark.ui.reverseProxyUrl") map { reverseProxyUrl =>
+ val proxyUrlNoSlash = reverseProxyUrl.stripSuffix("/")
+ System.setProperty("spark.ui.proxyBase", proxyUrlNoSlash)
+ // If the master URL has a path component, it must end with a
slash.
+ // Otherwise the browser generates incorrect relative links
+ masterWebUiUrl = proxyUrlNoSlash + "/"
--- End diff --
This section of code seems like more work than necessary. Can't you just
set `masterWebUiUrl = reverseProxyUrl` here and then move
`reverseProxyUrl.stripSuffix("/")` into `System.setProperty` making this a two
line function?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]