content_encoding: only do tranfer-encoding compression if asked to

To reduce surprises. Update test 387 and 418 accordingly.

Closes #10899
This commit is contained in:
Daniel Stenberg 2023-04-06 12:11:42 +02:00
parent 3de6b6cfe5
commit 4033642930
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 34 additions and 106 deletions

View file

@ -53,6 +53,9 @@
#include "content_encoding.h"
#include "strdup.h"
#include "strcase.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
@ -1077,8 +1080,12 @@ CURLcode Curl_build_unencoding_stack(struct Curl_easy *data,
Curl_httpchunk_init(data); /* init our chunky engine. */
}
else if(namelen) {
const struct content_encoding *encoding = find_encoding(name, namelen);
const struct content_encoding *encoding;
struct contenc_writer *writer;
if(is_transfer && !data->set.http_transfer_encoding)
/* not requested, ignore */
return CURLE_OK;
encoding = find_encoding(name, namelen);
if(!k->writer_stack) {
k->writer_stack = new_unencoding_writer(data, &client_encoding,