title: Compressed JSON Content Type
body: <p>I'm integrating a 3rd party API, and at one step they post JSON data into our server.</p>
  
  <p>The content type they are sending is <code>application/json</code>, but the payload is actually gzipped, is this valid? I believe it should be <code>gzip/json</code> content type.</p>
  
  <p><strong>Update 1</strong></p>
  
  <p>the <code>env["RAW_POST_DATA"]</code> contains binary data, rather than JSON in text format that I would expect.</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>This is a fairly standard Rails application, hosted on heroku with Puma for staging and production.</p>
  
  <p><strong>Update 3</strong></p>
  
  <p>I've not debugged at this level on heroku previously, <strike>so it's possible that I'm missing something, but I do not see a content-encoding header</strike> (I did miss the <code>"HTTP_CONTENT_ENCODING"=&gt;"gzip"</code> header). The headers that I do get are:</p>
  
  <pre><code>2015-12-04T08:00:08.001620+00:00 app[web.1]: D, [2015-12-04T08:00:08.001590 #7] DEBUG -- : REQUEST_PATH: /
  2015-12-04T08:00:08.001660+00:00 app[web.1]: D, [2015-12-04T08:00:08.001620 #7] DEBUG -- : REQUEST_URI: /
  2015-12-04T08:00:08.001701+00:00 app[web.1]: D, [2015-12-04T08:00:08.001656 #7] DEBUG -- : HTTP_VERSION: HTTP/1.1
  2015-12-04T08:00:08.001735+00:00 app[web.1]: D, [2015-12-04T08:00:08.001698 #7] DEBUG -- : HTTP_HOST: staging.redacted.com
  2015-12-04T08:00:08.001768+00:00 app[web.1]: D, [2015-12-04T08:00:08.001732 #7] DEBUG -- : HTTP_CONNECTION: close
  2015-12-04T08:00:08.001801+00:00 app[web.1]: D, [2015-12-04T08:00:08.001765 #7] DEBUG -- : HTTP_ACCEPT:
  2015-12-04T08:00:08.001823+00:00 app[web.1]: D, [2015-12-04T08:00:08.001798 #7] DEBUG -- : CONTENT_LENGTH: 277
  2015-12-04T08:00:08.001861+00:00 app[web.1]: D, [2015-12-04T08:00:08.001826 #7] DEBUG -- : CONTENT_TYPE: application/json
  2015-12-04T08:00:08.001918+00:00 app[web.1]: D, [2015-12-04T08:00:08.001858 #7] DEBUG -- : HTTP_CACHE_CONTROL:
  2015-12-04T08:00:08.001920+00:00 app[web.1]: D, [2015-12-04T08:00:08.001891 #7] DEBUG -- : HTTP_ORIGIN:
  2015-12-04T08:00:08.001958+00:00 app[web.1]: D, [2015-12-04T08:00:08.001921 #7] DEBUG -- : HTTP_USER_AGENT: Apache-HttpClient/4.3.4 (java 1.5)
  2015-12-04T08:00:08.001996+00:00 app[web.1]: D, [2015-12-04T08:00:08.001953 #7] DEBUG -- : HTTP_POSTMAN_TOKEN:
  2015-12-04T08:00:08.002029+00:00 app[web.1]: D, [2015-12-04T08:00:08.001992 #7] DEBUG -- : HTTP_DNT:
  2015-12-04T08:00:08.001801+00:00 app[web.1]: D, [2015-12-04T08:00:08.001765 #7] DEBUG -- : HTTP_CONTENT_ENCODING: gzip
  2015-12-04T08:00:08.002074+00:00 app[web.1]: D, [2015-12-04T08:00:08.002027 #7] DEBUG -- : HTTP_ACCEPT_ENCODING: gzip,deflate
  2015-12-04T08:00:08.002093+00:00 app[web.1]: D, [2015-12-04T08:00:08.002061 #7] DEBUG -- : HTTP_ACCEPT_LANGUAGE:
  2015-12-04T08:00:08.002137+00:00 app[web.1]: D, [2015-12-04T08:00:08.002094 #7] DEBUG -- : HTTP_COOKIE:
  </code></pre>
  
  <p>And the raw post data prints out as:</p>
  
  <pre><code>2015-12-04T08:00:08.002165+00:00 app[web.1]: D, [2015-12-04T08:00:08.002128 #7] DEBUG -- : RAW_POST_DATA:
  2015-12-04T08:00:08.002166+00:00 app[web.1]:
  2015-12-04T08:00:08.002168+00:00 app[web.1]: ���_%���R�@�S%@�4ݶ��n���wg�4$Wz��9�/me�J���pоp     Eٍ��!B�,N��@��k4g�
  2015-12-04T08:00:08.002169+00:00 app[web.1]: -���*c�8�[�PK&amp;DفR���LM�
  2015-12-04T08:00:08.002169+00:00 app[web.1]: k=t@:?"'��Ip|�dpg��縼Ѻ|�u�cBC��Hly��*�ǯ'Meq�W�]N͛C�F
  </code></pre>