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

sun.net.www.URLConnection does not implement getHeaderFields()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • tbd
    • 14
    • core-libs
    • None
    • generic
    • generic

      The base class used for a number of the URL connection classes does not implement the getHeaderFields() method resulting in an empty map always being returned. This results in inconsistent behaviour with getHeaderField("some-header") returning non-null results for valid headers such as "content-length" at the same time as the getHeaderFields() method is reporting that there no headers associated with the URL.

      A straightforward implementation that copies headers from the MessageHeader properties object in to a new TreeMap(String.CASE_INSENSITIVE_ORDER) is possible.

            michaelm Michael McMahon
            mduigou Mike Duigou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: