Uploaded image for project: 'Puppet Server'
  1. Puppet Server
  2. SERVER-1755

Avoid decoding msgpack request body as UTF-8

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • SERVER 5.1.0
    • None
    • None
    • Platform Core
    • 1
    • Platform Core 2017-08-08
    • Bug Fix
    • Hide
      When the puppet agent is set to send data in Msgpack format, previously the server wouldn't handle it correctly, because it tried to interpret the binary data as UTF-8. We now have a special case for msgpack data, so it is passed along as binary, just as it came in.
      Show
      When the puppet agent is set to send data in Msgpack format, previously the server wouldn't handle it correctly, because it tried to interpret the binary data as UTF-8. We now have a special case for msgpack data, so it is passed along as binary, just as it came in.
    • No Action
    • Covered by spec tests

    Description

      Currently, if a request body with a Content-Type of "application/x-msgpack" is sent into Puppet Server, it will inappropriately be decoded into a string as UTF-8. Instead, like is done for application/octet-stream, the raw bytes of the request body should be passed on through the indirector in Ruby Puppet, without any preliminary decoding.

      The production code change for this ticket may just involve changing this line to:

      (nil "" "application/octet-stream" "application/x-msgpack") body
      

      Along with this change, some sort of automated "integration" test should be written to validate that the msgpack payload is preserved / handled correctly through the request pipeline.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jeremy.barlow Jeremy Barlow
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support