Closed jsnjack closed 1 year ago
@jsnjack thank you for supplying the fix for that. will include that in the next release and i think about adding an option to the tlsclient itself to be able to set DisableCompression to either true or false.
Thanks!
By the way, tlsclient already has this option. It can be set via TransportOptions
When retrieving a resource via http2, fhttp library always decompresses the body, even if DisableCompression is set to true. According to the option description this should not happen:
I looked into parts which read body in http1 and http2 and compared them. http1 has
addedGzip
flag which is checked before callingDecompressBody
function (https://github.com/bogdanfinn/fhttp/blob/959a7f72d1ca6d6319e1ed82a26eea431658d3b3/transport.go#L2190). In http2 we haverequestedGzip
flag, which acts in similar way. However,requestedGzip
is not checked (https://github.com/bogdanfinn/fhttp/blob/master/http2/transport.go#L2259).The following change seem to solve the issue https://github.com/bogdanfinn/fhttp/commit/8237b3b211da3c741ce9d3fe20a5187e5bb7a694