From b676ae3b2ae104c62b0c6e7b00fe925678524f37 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 6 Apr 2025 00:40:56 +0200 Subject: [PATCH] CURLOPT_HTTP_TRANSFER_DECODING: fixed The fix in b8bd019c6a02182 (#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 --- lib/content_encoding.c | 2 +- lib/setopt.c | 4 ---- tests/data/DISABLED | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 3ca24607a1..f2e77eede1 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -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); diff --git a/lib/setopt.c b/lib/setopt.c index e8fec8de8a..f982366209 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -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: /* diff --git a/tests/data/DISABLED b/tests/data/DISABLED index 9f5974233c..5b27569ce8 100644 --- a/tests/data/DISABLED +++ b/tests/data/DISABLED @@ -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 -- 2.47.3