mirror of
https://github.com/curl/curl.git
synced 2026-06-02 03:04:15 +03:00
content_encoding: fix limit failure message
The message triggered earlier than intended and did not take the transfer/content type into account. Ref #21603 Reported-by: Joshua Rogers Closes #21756
This commit is contained in:
parent
a8e6f90a69
commit
049ec8a363
3 changed files with 6 additions and 5 deletions
|
|
@ -750,9 +750,10 @@ CURLcode Curl_build_unencoding_stack(struct Curl_easy *data,
|
|||
return CURLE_OK;
|
||||
}
|
||||
|
||||
if(Curl_cwriter_count(data, phase) + 1 >= MAX_ENCODE_STACK) {
|
||||
failf(data, "Reject response due to more than %d content encodings",
|
||||
MAX_ENCODE_STACK);
|
||||
if(Curl_cwriter_count(data, phase) >= MAX_ENCODE_STACK) {
|
||||
failf(data, "Reject response exceeding limit of %d %s encodings",
|
||||
MAX_ENCODE_STACK,
|
||||
is_transfer ? "transfer" : "content");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ Connection: TE
|
|||
61
|
||||
</errorcode>
|
||||
<stderr mode="text">
|
||||
curl: (61) Reject response due to more than 5 content encodings
|
||||
curl: (61) Reject response exceeding limit of 5 transfer encodings
|
||||
</stderr>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ Connection: TE
|
|||
61
|
||||
</errorcode>
|
||||
<stderr mode="text">
|
||||
curl: (61) Reject response due to more than 5 content encodings
|
||||
curl: (61) Reject response exceeding limit of 5 transfer encodings
|
||||
</stderr>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue