rubiii/httpi — Issue #47: gzip data in body gets un-compessed automatically
Author: dklimkin
Created: 2012-02-13 13:03:05+00:00
State: open

I am working on an API which return data gzipped on request. This is not an HTTP-level compression but the response compression only.

Case A, headers (problem):
"Content-Type"=>"application/x-gzip; charset=UTF-8"
"Content-Disposition"=> "attachment; filename=\"report.csv.gz\""
@raw_body=> "\037\213\b\000\000\000...."

Case B, headers (works as expected):
"Content-Encoding"=>"gzip"
"Content-Type"=>"text/csv; charset=UTF-8"
@raw_body="\037\213\b\000\000\000...."

For case A expected body is raw gzip, for case B - unpacked CSV.
Actual result for both cases is unpacked CSV.