Most of the time Pacto seems to be handling compression okay, but I just ran across a test where pacto was proxying a compressed response and responded with a compressed body but without the proper headers. I'm not sure if this was a pacto issue or if the server itself wasn't sending the proper headers.
The workaround was to not forward accept-encoding, but a more proper fix is to make sure the body is decoded as necessary.
Note: This worked, at least for a Gzip stream: Zlib::GzipReader.new(StringIO.new(pacto_response.body))
Most of the time Pacto seems to be handling compression okay, but I just ran across a test where pacto was proxying a compressed response and responded with a compressed body but without the proper headers. I'm not sure if this was a pacto issue or if the server itself wasn't sending the proper headers.
The workaround was to not forward accept-encoding, but a more proper fix is to make sure the body is decoded as necessary.
Note: This worked, at least for a Gzip stream:
Zlib::GzipReader.new(StringIO.new(pacto_response.body))