puppetlabs/puppet-server — pull request #344 by camlow325 (2014-12-23 00:48:25+00:00)
Title: (SERVER-269) Passthrough binary payload properly for master requests

In the previous commit, the body for any HTTP requests made to the
Puppet master service with a Content-Type of or
"application/octet-stream" was inappropriately decoded into a UTF-8
string.

With the changes in this commit, the body for any HTTP requests made to
the Puppet master service with a Content-Type of or
"application/octet-stream" is now passed through as raw bytes to the
JRuby request layer, where it is converted into an ASCII-8BIT Ruby
String.

Puppet agent requests to the "file_bucket_file" endpoint include a
Content-Type of "text/plain". While these requests should technically,
per the HTTP spec, be transformed to ISO-8859-1 or US-ASCII instead of
UTF-8, the actual payload is intended to be treated as "binary". This
commit treats requests to the "file_bucket_file" endpoint as though they
were including an "application/octet-stream" Content-Type, allowing the
raw bytes in the request body to be sent down to the JRuby request layer.