vanzin commented on a change in pull request #25301: [SPARK-28564][CORE] Access 
history application defaults to the last attempt id
URL: https://github.com/apache/spark/pull/25301#discussion_r308885657
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala
 ##########
 @@ -97,7 +108,17 @@ class HistoryServer(
       // 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.
       // Also, make sure that the redirect url contains the query string 
present in the request.
-      val requestURI = req.getRequestURI + Option(req.getQueryString).map("?" 
+ _).getOrElse("")
+      val attemptPart = if (shouldAppendAttemptId) {
+        if (!req.getRequestURI.endsWith("/")) {
 
 Review comment:
   Simpler: 
   
   ```
   val redirect = if (shouldAppendAttemptId) {
     req.getRequestURI().stripSuffix("/") + "/" + attemptId.get
   } else {
     req.getRequestURI()
   }
   val query = Option(req.getQueryString).map("?" + _).getOrElse("")
   res.sendRedirect(...)
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to