socketry / multipart-post

Adds multipart POST capability to net/http
MIT License
293 stars 72 forks source link

Fix FilePart length calculation for Ruby 1.9 when filename contains multibyte characters #21

Closed hexfet closed 10 years ago

hexfet commented 12 years ago

Applicable RFCs (http://en.wikipedia.org/wiki/MIME#Encoded-Word, http://stackoverflow.com/questions/1361604) indicate only ASCII8BIT is allowed in headers and suggest encoding options, but Chrome and Firefox put multibyte characters in the header and the Rails stack handles it correctly, so just fix the length.

The test is written the way it is to avoid embedding multibyte characters in the source file.

nicksieger commented 10 years ago

Thanks!