Missing "type" parameter for Multipart/Related

Issue #2 resolved
Former user created an issue

Hi,

I wanted to use this gem to generate a multipart/related message sent over HTTP. Unfortunately, the HTTP server denied my requests complaining about the errorneous content type. I did some research and found that for multipart/related a root content type actually needs to be defined (see RFC 2387, Chapter 3.1), e.g.:

Content-Type: multipart/related; boundary="abcdefg"; type="application/xml"

It seems that not all implementations follow this specification, but my server does :).

So perhaps you could add this to your gem, e.g.:

MIME::Multipart::Related.new("application/xml")

Thank you!

Comments (1)

  1. Clint Pachl repo owner

    Thank you for reporting this RFC incompliance issue. It has been fixed in changeset 80c3b90 and released in ruby gem 0.4.3.

    RFC-2387 states: "The type parameter must be specified and its value is the MIME media type of the 'root' body part. ... If the value of the type parameter and the root body part's content-type differ then the User Agent's behavior is undefined."

    Therefore, it is best if the Multipart/Related type parameter is set automatically by the library. There shouldn't be a need to manually set the "type" parameter.

  2. Log in to comment