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

Typo in java.net.http.AuthenticationFilter

XMLWordPrintable

    • b131
    • Not verified

      Line 191 -195, it is trying to find value for header "Proxy-Authentication". This is a typo. It should be "Proxy-Authenticate"

              boolean proxy = status == PROXY_UNAUTHORIZED; //Actually 407
              String authname = proxy ? "Proxy-Authentication" : "WWW-Authenticate";
              String authval = hdrs.firstValue(authname).orElseThrow(() -> {
                  return new IOException("Invalid auth header");
              });

      Please refer to the RFC https://tools.ietf.org/html/rfc2617#section-3.6
      As documented:
         Upon receiving a request which requires authentication, the proxy/server
         must issue the "407 Proxy Authentication Required" response with a
         "Proxy-Authenticate" header.

            xiaofeya Xiaofeng Yang
            xiaofeya Xiaofeng Yang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: