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

Add application/octet-stream MIME type to static_file_content response

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: SERVER 5.0.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Systems Engineering
    • Sub-team:
    • Story Points:
      1
    • Sprint:
      Server 2017-06-14
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      The responses for any requests made to the puppet/v3/static_file_content endpoint previously did not include a Content-Type header. Now, responses for successful requests will include a Content-Type header with a value of "application/octet-stream". Error responses from this endpoint will include a Content-Type of "text/plain".
      Show
      The responses for any requests made to the puppet/v3/static_file_content endpoint previously did not include a Content-Type header. Now, responses for successful requests will include a Content-Type header with a value of "application/octet-stream". Error responses from this endpoint will include a Content-Type of "text/plain".
    • QA Risk Assessment:
      Needs Assessment

      Description

      In responses made to the static_file_content endpoint today, no value for the Content-Type header is defined. See this map definition. In turn, it does not appear that either Ring middleware or the underlying Jetty webserver add in a default value for the header either. For example, I see this on the wire for a request:

      "GET /puppet/v3/static_file_content/modules/something/files/somefile.txt?environment=production&code_id=1234 HTTP/1.1\r\nAccept: binary\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nUser-Agent: Ruby\r\nHost: my-host:8140\r\n\r\n"
      -> "HTTP/1.1 200 OK\r\n"
      -> "Date: Fri, 02 Jun 2017 20:27:49 GMT\r\n"
      -> "X-Puppet-Version: 5.0.0\r\n"
      -> "Content-Length: 5\r\n"
      -> "Server: Jetty(9.4.4.v20170414)\r\n"
      -> "\r\n"
      reading 5 bytes...
      -> "test\n"
      

      For good form, we should add a Content-Type header to the response. Since the content which is provided is translated as an input stream into raw bytes, the best Content-Type to use here is probably application/octet-stream.

        Attachments

          Activity

            People

            • Assignee:
              justin Justin Stoller
              Reporter:
              jeremy.barlow Jeremy Barlow
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support