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

    https://github.com/apache/spark/pull/1980#discussion_r18432586
  
    --- Diff: core/src/main/scala/org/apache/spark/ui/JettyUtils.scala ---
    @@ -205,10 +231,88 @@ private[spark] object JettyUtils extends Logging {
         ServerInfo(server, boundPort, collection)
       }
     
    +  private def newURI(scheme: String, server: String, port: Int, path: 
String, query: String) = {
    +    val builder = newURIBuilder(scheme, server, port)
    +    builder.append(path)
    +    if (query != null && query.length > 0) 
builder.append('?').append(query)
    +    builder.toString
    +  }
    +
    +  private def newURIBuilder(scheme: String, server: String, port: Int) = {
    +    val builder = new StringBuilder
    +    appendSchemeHostPort(builder, scheme, server, port)
    +    builder
    +  }
    +
    +  private def appendSchemeHostPort(url: StringBuilder, scheme: String, 
server: String, port: Int) {
    +    if (server.indexOf(':') >= 0 && server.charAt(0) != '[') {
    +      
url.append(scheme).append("://").append('[').append(server).append(']')
    +    } else {
    +      url.append(scheme).append("://").append(server)
    +    }
    +    if (port > 0) {
    +      url.append(':').append(port)
    +    }
    +  }
    +
    +  private def createRedirectHttpsHandler(securePort: Int, schema: String): 
ContextHandler = {
    +    val redirectHandler: ContextHandler = new ContextHandler
    +    redirectHandler.setContextPath("/")
    +    redirectHandler.setHandler(new AbstractHandler {
    +      @Override def handle(
    +                    target: String,
    +                    baseRequest: Request,
    +                    request: HttpServletRequest,
    +                    response: HttpServletResponse): Unit = {
    +        if (baseRequest.isSecure) {
    +          return
    +        }
    +        if (securePort > 0) {
    --- End diff --
    
    Hmm, yes, it a no use condition :)


---
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