lostisland/faraday — pull request #284 by lloydmeta (2013-07-12 10:29:09+00:00)
Title: Add space after semicolon in multipart post

Took me a while to figure out why multipart posting with Faraday vs Multipart-Post.

__TL;DR__ Some servers don't like it when headers don't have a space following semicolons in request headers. My suggestion is to stick with convention in core Ruby libs and RFC examples to avoid issues. This PR does that for the multipart post part of Faraday.

-----

Turns out that the Content-Type was being sent as "Content-Type: multipart/form-data;boundary=-----------RubyMultipartPost" without the space after the semicolon and before the boundary definition, whereas when using Multipart-post, there is a space because it uses set-content-type in [Net::HTTPHeader](http://ruby-doc.org/stdlib-1.9.3/libdoc/net/http/rdoc/Net/HTTPHeader.html#method-i-set_content_type), which sets a space. This was throwing off a service that I am using to upload photos to.

Not having the space is theoretically perfectly fine, as the [RFC spec](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html) does not specify that that there needs to be a space, although all the examples on the page do have the space in them. However, I think if there are no objections, it would be nice to follow convention set in the standard Ruby library (and thus Multipart-post), as well as RFC to avoid pesky servers throwing errors (like with [Exchange 2010](https://github.com/unwire/handsoap/pull/18))