Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-2342

Regression: Content-Type header not returned anymore

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 5.4-beta1
    • None
    • HttpClient (classic)
    • None

    Description

      Hello,

      We just upgraded today to httpclient5 version 5.4. It seems that the header `Content-Type` is not returned anymore by the API, even when listing all the headers.

      client.execute(httpRequest, r -> {
          //does not print Content-Type header 
          for(Header h : r.getHeaders()) {
              System.out.println("## "+h.getName()+": "+h.getValue());
          }
          System.out.flush();
          return null;
      });
      

      We can ensure that the `Content-Type` header is well set by the server by browsing to the same URL and inspecting the network.

      Our code didn't change and with the version 5.3.1, the Content-Type is correctly received.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ctabin Cedric Tabin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: