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

Http header parser isn't compatible.

XMLWordPrintable

    • b25
    • 16
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      When http-response-header end with ' ' (blank), the request will be failed.

      In sumbit: https://github.com/openjdk/jdk/commit/1c47244b01dd9e7e176dd91215baef2afbc2626f
      File: src/java.net.http/share/classes/jdk/internal/net/http/Http1HeaderParser.java

      In SDK11, line 261: String name = headerString.substring(0, idx).trim();
      In SDK17, line 286: String name = headerString.substring(0, idx);

      You could see the 'trim()' is removed and this cause a compatible problem.
      Line 291: if (!Utils.isValidName(name)) {
      Will be failed in this case.

      REGRESSION : Last worked in version 11.0.14

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Start a server side app, which provide an endpoint that respond to any request with an header ('Expires' for example). Add a ' '(blank) after the header name ('Expires ' for example). Send a request to the endpoint.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Normal response. Just like in Chrome or other browser.
      ACTUAL -
      HTTP client exception.

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: