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

FileBodyPart.generateContentType() method ignores ContentType parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.3.1, 4.3.2
    • 4.3.3, 4.4 Alpha1
    • HttpClient (classic)
    • None
    • OS X 10.9.1 Mavericks, Apple WebObjects, Project Wonder

    Description

      When generating the Content-Type header of a body part the FileBodyPart.generateContentType() method does not take into account possible Content-Type parameters.

      Up to version 4.2.3 I used to add the parameters by appending them to the MIME type, e.g. "application/xml; param=XYZ". Since ver. 4.3.1, however, the ContentType constructor has an additional check - Args.check(valid(type), "MIME type may not contain reserved characters"); - which fails because of the semi-colon.

      A proper fix seems not very trivial though, as access to content-type parameters could be gained through neither ContentBody, nor ContentDescriptor.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bzlat Bogdan Zlatanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: