Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-382

org.apache.http.entity.ContentType#get method is too strict regarding malformed Content-Type headers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.3.2
    • 4.4-alpha1
    • HttpCore
    • None

    Description

      One HTTP server serving up ZIP/JAR file sends this header in it's response:

      Content-Type: application/zip; charset=binary
      

      While this is malformed header value (according to rfc2068 "Applications SHOULD limit their use of character sets to those defined by the IANA registry", and IANA does not define "binary"), HttpClient should be more robust IMO.

      In this case, it might accept the mime type application/zip only and just neglect the charset (that results in java.nio.charset.UnsupportedCharsetException: binary anyway), since application/zip is not a text subtype.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cstamas Tamas Cservenak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: