CURLOPT_HTTP_TRANSFER_DECODING: fixed

The fix in b8bd019c6a (#16959) broke the
CURLOPT_HTTP_TRANSFER_DECODING handling, shown in test 319 and curl's
--raw option.

This is a follow-up that restores the functionality.

Enable test 319 again.

Fixes #16974
Closes #16984
This commit is contained in:
Daniel Stenberg 2025-04-06 00:40:56 +02:00
parent 213115bd7e
commit b676ae3b2a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 1 additions and 7 deletions

View file

@ -770,7 +770,7 @@ CURLcode Curl_build_unencoding_stack(struct Curl_easy *data,
/* not requested, ignore */
CURL_TRC_WRITE(data, "decoder not requested, ignored: %.*s",
(int)namelen, name);
if(is_transfer) {
if(is_transfer && !data->set.http_te_skip) {
if(has_chunked)
failf(data, "A Transfer-Encoding (%.*s) was listed after chunked",
(int)namelen, name);

View file

@ -1129,12 +1129,8 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
/*
* disable libcurl transfer encoding is used
*/
#ifndef USE_HYPER
data->set.http_te_skip = !enabled; /* reversed */
break;
#else
return CURLE_NOT_BUILT_IN; /* hyper does not support */
#endif
case CURLOPT_HTTP_CONTENT_DECODING:
/*

View file

@ -27,8 +27,6 @@
# per line.
# Lines starting with '#' letters are treated as comments.
#
# PR #16959 makes Transfer-Encoding stricer and thus --raw broke
319
# Uses SRP to "a server not supporting it" but modern stunnel versions
# will silently accept it and remain happy
323