Skip to content

Commit 780ee62

Browse files
author
Rohit Agarwal
committed
SPARK-12186: Add a comment explaining the changes. Convert it to a one-liner.
1 parent 7625c88 commit 780ee62

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,9 @@ class HistoryServer(
103103
// Note we don't use the UI retrieved from the cache; the cache loader above will register
104104
// the app's UI, and all we need to do is redirect the user to the same URI that was
105105
// requested, and the proper data should be served at that point.
106-
if (req.getQueryString == null) {
107-
res.sendRedirect(res.encodeRedirectURL(req.getRequestURI()))
108-
} else {
109-
res.sendRedirect(res.encodeRedirectURL(req.getRequestURI + "?" + req.getQueryString))
110-
}
106+
// Also, make sure that the redirect url contains the query string present in the request.
107+
val requestURI = req.getRequestURI + Option(req.getQueryString).map("?" + _).getOrElse("")
108+
res.sendRedirect(res.encodeRedirectURL(requestURI))
111109
}
112110

113111
// SPARK-5983 ensure TRACE is not supported

0 commit comments

Comments
 (0)