aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohit Agarwal <rohita@qubole.com>2015-12-16 19:04:33 -0800
committerAndrew Or <andrew@databricks.com>2015-12-16 19:04:33 -0800
commitfdb38227564c1af40cbfb97df420b23eb04c002b (patch)
treeccceaf5520640e6d77d1fc0099c32c2657a266d4
parentf590178d7a06221a93286757c68b23919bee9f03 (diff)
downloadspark-fdb38227564c1af40cbfb97df420b23eb04c002b.tar.gz
spark-fdb38227564c1af40cbfb97df420b23eb04c002b.tar.bz2
spark-fdb38227564c1af40cbfb97df420b23eb04c002b.zip
[SPARK-12186][WEB UI] Send the complete request URI including the query string when redirecting.
Author: Rohit Agarwal <rohita@qubole.com> Closes #10180 from mindprince/SPARK-12186.
-rw-r--r--core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala b/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala
index d4f327cc58..f31fef0ecc 100644
--- a/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala
@@ -103,7 +103,9 @@ class HistoryServer(
// Note we don't use the UI retrieved from the cache; the cache loader above will register
// the app's UI, and all we need to do is redirect the user to the same URI that was
// requested, and the proper data should be served at that point.
- res.sendRedirect(res.encodeRedirectURL(req.getRequestURI()))
+ // Also, make sure that the redirect url contains the query string present in the request.
+ val requestURI = req.getRequestURI + Option(req.getQueryString).map("?" + _).getOrElse("")
+ res.sendRedirect(res.encodeRedirectURL(requestURI))
}
// SPARK-5983 ensure TRACE is not supported