Skip to content

Commit 7a329b8

Browse files
committed
Follow up clarification on CURLOPT_ACCEPT_ENCODING
Clarify that CURLOPT_ACCEPT_ENCODING has to be explicitly disabled only if it was previously enabled (as the default is NULL). Mention possible content-length mismatch with sum of bytes reported by write callbacks when auto decoding is enabled. See curl#785
1 parent 283babf commit 7a329b8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/libcurl/opts/CURLOPT_ACCEPT_ENCODING.3

+7-5
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ zlib algorithm, and \fIgzip\fP which requests the gzip algorithm.
3939
If a zero-length string is set like "", then an Accept-Encoding: header
4040
containing all built-in supported encodings is sent.
4141

42-
Set this option to NULL to explicitly disable it, which makes libcurl not send
43-
an Accept-Encoding: header and not decompress contents automatically.
42+
Set this option to NULL to explicitly disable it (in case it was previously
43+
enabled on the CURL handle), which makes libcurl not send an Accept-Encoding:
44+
header and not decompress contents automatically.
4445

4546
You can also opt to just include the Accept-Encoding: header in your request
4647
with \fICURLOPT_HTTPHEADER(3)\fP but then there will be no automatic
@@ -54,9 +55,10 @@ Servers might respond with Content-Encoding even without getting a
5455
Accept-Encoding: in the request. Servers might respond with a different
5556
Content-Encoding than what was asked for in the request.
5657

57-
The Content-Length: servers send for a compressed response is supposed to be
58-
for the compressed content but sending the size for the non-compressed version
59-
of the resource is a very common mistake.
58+
The Content-Length: servers send for a compressed response is supposed to
59+
indicate the length of the compressed content so when auto decoding is enabled
60+
it may not match the sum of bytes reported by the write callbacks (although,
61+
sending the length of the non-compressed content is a common server mistake).
6062
.SH DEFAULT
6163
NULL
6264
.SH PROTOCOLS

0 commit comments

Comments
 (0)