Github user mindprince commented on a diff in the pull request:
https://github.com/apache/spark/pull/8014#discussion_r36612982
--- Diff: core/src/main/scala/org/apache/spark/ui/JettyUtils.scala ---
@@ -251,6 +251,13 @@ private[spark] object JettyUtils extends Logging {
private def attachPrefix(basePath: String, relativePath: String): String
= {
if (basePath == "") relativePath else (basePath +
relativePath).stripSuffix("/")
}
+
+ /**
+ * Attach a prefix to the given path, don't remove the trailing / if
present.
+ */
+ private def attachPrefixForRedirect(basePath: String, relativePath:
String): String = {
--- End diff --
> I am not sure why the suffix-stripping logic exists in the first place
but that may be too far afield.
That's because `contextHandler.setContextPath()` which uses the result of
`attachPrefix`, throws an `IllegalArgumentException` when the path ends with /.
> Yes but I'm curious why basePath == "" plus relativePath == "foo/" should
retain its trailing slash but not when basePath is non-empty. Is it really
basePath =="" && relativePath =="/" that should be handled specially?
Yes, it seems like only `basePath =="" && relativePath =="/"` should be
handled specially. In fact, `basePath == ""` plus `relativePath == "foo/"`
would result in the `IllegalArgumentException` mentioned above. I guess we just
never encountered that case.
---
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]