Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8320412

NullPointerException in HttpServer on CONNECT attempts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 18
    • core-libs
    • None

      jwebserver (and more generally HttpServer) may throw NullPointerException if a client attempts to send a CONNECT request:

      Nov 20, 2023 2:50:47 PM sun.net.httpserver.ServerImpl$Exchange run
      FINER: exchange started
      Nov 20, 2023 2:50:47 PM sun.net.httpserver.ServerImpl$Exchange run
      FINE: Exchange request line: CONNECT www.example.com:443 HTTP/1.1
      Nov 20, 2023 2:50:47 PM sun.net.httpserver.ServerImpl$Exchange run
      FINER: ServerImpl.Exchange
      java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "path" is null
      at jdk.httpserver/sun.net.httpserver.ContextList.findContext(ContextList.java:68)
      at jdk.httpserver/sun.net.httpserver.ContextList.findContext(ContextList.java:54)
      at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:776)
      at jdk.httpserver/sun.net.httpserver.ServerImpl$DefaultExecutor.execute(ServerImpl.java:203)
      at jdk.httpserver/sun.net.httpserver.ServerImpl$Dispatcher.handle(ServerImpl.java:566)
      at jdk.httpserver/sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:531)
      at java.base/java.lang.Thread.run(Thread.java:1570)

            jpai Jaikiran Pai
            dfuchs Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: