Github user sarutak commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16582#discussion_r97750499
  
    --- Diff: core/src/test/scala/org/apache/spark/ui/UISuite.scala ---
    @@ -227,8 +228,55 @@ class UISuite extends SparkFunSuite {
         assert(newHeader === null)
       }
     
    +  test("http -> https redirect applies to all URIs") {
    +    var serverInfo: ServerInfo = null
    +    try {
    +      val servlet = new HttpServlet() {
    +        override def doGet(req: HttpServletRequest, res: 
HttpServletResponse): Unit = {
    +          res.sendError(HttpServletResponse.SC_OK)
    +        }
    +      }
    +
    +      def newContext(path: String): ServletContextHandler = {
    +        val ctx = new ServletContextHandler()
    +        ctx.setContextPath(path)
    +        ctx.addServlet(new ServletHolder(servlet), "/*")
    +        ctx
    +      }
    +
    +      val (conf, sslOptions) = sslEnabledConf()
    +      serverInfo = JettyUtils.startJettyServer(
    +        "0.0.0.0", 0, sslOptions, 
Seq[ServletContextHandler](newContext("/")), conf)
    --- End diff --
    
    To test the neseccity of `setVirtualHost` in `JettyUtils#StartJettyServer` 
correctly, you might need to add another ServletContextHandler instance like 
`newContext("/test0")` and corresponding assertion.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to