NullPointerException in HttpServer on CONNECT attempts

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 18
    • Component/s: 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)

            Assignee:
            Jaikiran Pai
            Reporter:
            Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: