Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-3940

Puppet requests should include "real" MIME types

    XMLWordPrintable

    Details

    • Template:
    • Acceptance Criteria:
      Hide

      Agent sends requests with text/plain MIME type (and prefers that over s).

      Show
      Agent sends requests with text/plain MIME type (and prefers that over s).
    • Team:
      Agent
    • Story Points:
      1
    • Sprint:
      Agent 2017-06-14
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Puppet will now send proper MIME content types, e.g. application/json, instead of format names, e.g. json, in its Accept header when making HTTP requests.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      Check in includes tests for the change

      Description

      When a Puppet agent makes requests to a master, the values it uses in the Accept header do not correspond to industry-standard MIME types - although it really seems like they should.

      For example, a request to the node endpoint includes:

      GET /production/node/my-node?transaction_uuid=39794d9e-a0c8-4a5b-bcee-d20efa1555b5&fail_on_404=true
      Accept: pson, b64_zlib_yaml, yaml, raw
      

      For better HTTP spec compatibility, the request should look more like:

      GET /production/node/my-node?transaction_uuid=39794d9e-a0c8-4a5b-bcee-d20efa1555b5&fail_on_404=true
      Accept: text/pson, text/b64_zlib_yaml, text/yaml, application/x-raw
      

      Josh Cooper believes that this change would be fairly easy to make from the client side. Would need to call "model.get_format(format).mime" for each supported format to be added into the Accept header. Presumably, we'd have to have something on the server side to do the corresponding "decode" of the MIME type value back to the short-hand symbols that the server use to determine whether the client's request is valid. Not sure exactly what those changes would look like at this point.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ethan Ethan Brown
              Reporter:
              jeremy.barlow Jeremy Barlow
              QA Contact:
              Eric Delaney
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support