Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content-Type header incomplete for "multipart/related" requests #1416

Closed
pronvit opened this issue Feb 8, 2015 · 5 comments · Fixed by #1423
Closed

Content-Type header incomplete for "multipart/related" requests #1416

pronvit opened this issue Feb 8, 2015 · 5 comments · Fixed by #1423

Comments

@pronvit
Copy link

pronvit commented Feb 8, 2015

From RFC:

3.1.  The Type Parameter

   The type parameter must be specified and its value is the MIME media
   type of the "root" body part.  It permits a MIME user agent to
   determine the content-type without reference to the enclosed 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.

3.2.  The Start Parameter

   The start parameter, if given, is the content-ID of the compound
   object's "root".  If not present the "root" is the first body part in
   the Multipart/Related entity.  The "root" is the element the
   applications processes first.
@simov
Copy link
Member

simov commented Feb 9, 2015

That citation is nice, but can you give us an example, also you can set your multipart header by yourself (if that works for you)

request({headers:{'content-type':'multipart/related; something=else'}})

@pronvit
Copy link
Author

pronvit commented Feb 9, 2015

In my case it has to be

Content-Type: multipart/related; boundary=XXX; type=text/xml; start="<root>"

Where text/xml and <root> are content-type and content-id of the main part (it's a soap request with attachment).

According to https://github.com/request/request/blob/master/request.js#L1386 if I pass content-type myself, it will take only substring before the first ';', which is effectively multipart/related only, so it won't help. I don't understand the purpose of that line completely, actually.

@simov
Copy link
Member

simov commented Feb 9, 2015

Got it, it's a bug. I will add a failing test case and a fix once #1413 got in.

@pronvit
Copy link
Author

pronvit commented Feb 9, 2015

Thanks.

@nylen
Copy link
Member

nylen commented Feb 11, 2015

that link should be https://github.com/request/request/blob/v2.53.0/request.js#L1386 (links to specific lines in master tend to break quickly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants