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
At https://curl.se/docs/manpage.html#--compressed the document states that "Headers are not modified" which led me to believe that if I did not pass an Accept-Encoding that no compression would actually happen. However, it seems that if noAccept-Encoding is passed, then a default of "deflate, gzip, br, zstd" will be set.
On a second read, with this knowledge in mind, it seems more clear that the header will be added if missing, but not modified if present. Maybe there is a rewording of this paragraph that better indicates the behavior? My suggestion:
(HTTP) Request a compressed response using one of the algorithms curl supports, and automatically decompress the content. Existing headers are not modified, but required headers (like Accept-Encoding) will be added if missing.
Someone who is more familiar with the feature could probably explain it better 😅
The text was updated successfully, but these errors were encountered:
This (comes from #5217) means that curl does not remove any headers from the response when it decompresses the content and passes on/saves the headers. It could possibly be clarified further, perhaps to say "response headers".
diff --git a/docs/cmdline-opts/compressed.d b/docs/cmdline-opts/compressed.d
index 97ab1b10b..4921bdb47 100644
--- a/docs/cmdline-opts/compressed.d+++ b/docs/cmdline-opts/compressed.d@@ -8,10 +8,14 @@ Example: --compressed $URL
Request a compressed response using one of the algorithms curl supports, and
-automatically decompress the content. Headers are not modified.+automatically decompress the content.++Response headers are not modified when saved, so if they are "interpreted"+separately again at a later point they might appear to be saying that the+content is (still) compressed; while in fact it has already been decompressed.
If this option is used and the server sends an unsupported encoding, curl will
report an error. This is a request, not an order; the server may or may not
deliver data compressed.