Closed ComLock closed 2 years ago
I guess (meaning, not official):
Accept-Encoding
- you are on your own. lib-http-client won't help you to decode the body.'*' is listed as the default here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding
Perhaps it's worth mentioning that we have "overridden" the default?
BTW. Was this changed recently? Say in 2.4.0?
It could simply be that the remote server now supports gzip, and my code doesn't handle that, yet.
Do we have any app using http-client and handling gzip? Could not find any lib on Enonic market that handles gzip... I do have some Java code handling an actual ZIP file on filesystem, but nothing taking a stream/string.
This is the default value if the header is not present
Well, It is present when you don't provide your own, because:
out of the box lib-http-client will add Accept-Encoding: gzip
Do we have any app using http-client and handling gzip?
But why, when http-client does it for you transparently?
Soooo, it handles it transparently (unzips the gzip) when you don't provide the header, but if you provide the header as gzip you get a gzip string which is NOT unzipped? Because I get a bunch of ���� as in binary string, when I provide the header...
lib-http-client is a wrapper on top of https://square.github.io/okhttp/ It says:
Transparent GZIP shrinks download sizes.
And you fell into this https://github.com/square/okhttp/issues/2132#issuecomment-169500736
The moral of the story: don't mess with http headers
will be fixed with #89
Does it support all the ones mentioned here? https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding