You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jack47
changed the title
auto gzip will fail when Content-Encoding is gzip but content-length is zero
auto gzip will fail when Content-Encoding is gzip and content-length is zero
Jun 26, 2018
* don't use gzipped reader when response content-length is zero
* add test case for auto gzip response
1. gzipped empty response, content-length will not be empty, because of gzip header
2. no gzipped body and content-length is zero
there are some cases that the response's content-length is zero, in this case the below code will return err because failure of
gzip.NewReader
.https://github.com/go-resty/resty/blob/master/client.go#L804-L812
gzip.NewReader(body) will try to read the gzip header, so the call will fail.
I added some test cases and fixed this locally, I would like to pull a request to fix this if needed.
The text was updated successfully, but these errors were encountered: