Skip to content

Commit 154567d

Browse files
Rohit AgarwalAndrew Or
authored andcommitted
[SPARK-12186][WEB UI] Send the complete request URI including the query string when redirecting.
Author: Rohit Agarwal <[email protected]> Closes #10180 from mindprince/SPARK-12186. (cherry picked from commit fdb3822) Signed-off-by: Andrew Or <[email protected]>
1 parent 4af6438 commit 154567d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +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-
res.sendRedirect(res.encodeRedirectURL(req.getRequestURI()))
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))
107109
}
108110

109111
// SPARK-5983 ensure TRACE is not supported

0 commit comments

Comments
 (0)