content_encoding: exact-match the identity transfer-coding token

Verified by test 2119

Closes #22541
This commit is contained in:
Alhuda Khan 2026-08-11 11:42:14 +05:30 committed by Daniel Stenberg
parent 4d9ba9fef4
commit f5378b88a9
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 57 additions and 2 deletions

View file

@ -783,7 +783,8 @@ CURLcode Curl_build_unencoding_stack(struct Curl_easy *data,
* Exception is "chunked" transfer-encoding which always must happen */
if((is_transfer && !data->set.http_transfer_encoding && !is_chunked) ||
(!is_transfer && data->set.http_ce_skip)) {
bool is_identity = curl_strnequal(name, "identity", 8);
bool is_identity = (namelen == 8) &&
curl_strnequal(name, "identity", 8);
/* not requested, ignore */
CURL_TRC_WRITE(data, "decoder not requested, ignored: %.*s",
(int)namelen, name);