mikeal/request — pull request #272 by proksoup (2012-06-18 15:55:33+00:00)
Title: Boundary begins with CRLF?

A (.NET) server I was working with was missing the first part of my multipart (i.e. it recognized the boundary of the second section I was sending, and thought it was the first section, but missed the existence of the first section entirely), until I added a CRLF at the beginning of my boundary as in the code in this pull request.

Reading the RFC it looks like it _might_ be required to be like that?

---

_Note that the encapsulation boundary must occur at the
beginning of a line, i.e., following a CRLF, and that that
initial CRLF is considered to be part of the encapsulation
boundary rather than part of the preceding part. The
boundary must be followed immediately either by another CRLF
and the header fields for the next part, or by two CRLFs, in
which case there are no header fields for the next part (and
it is therefore assumed to be of Content-Type text/plain)._

from [http://www.ietf.org/rfc/rfc1341.txt](http://www.ietf.org/rfc/rfc1341.txt)

---

I thought I'd share this pull request just in case there's something to it.