mirror of
https://github.com/curl/curl.git
synced 2026-08-05 03:16:13 +03:00
content_encoding: return 'identity' if none other exists
This fixes a regression and accidental changed behavior shipped in
8.18.0 (via 6b9c75e219).
When the setopt is set to "" and curl is built without support for a
single compression algorithm, it used to use "identity" but recently did
not.
Spotted by Codex Security
Closes #20805
This commit is contained in:
parent
d7e4473806
commit
27c3e0839a
1 changed files with 3 additions and 0 deletions
|
|
@ -622,6 +622,9 @@ char *Curl_get_content_encodings(void)
|
|||
result = curlx_dyn_add(&enc, ce->name);
|
||||
}
|
||||
}
|
||||
if(!result && !curlx_dyn_len(&enc))
|
||||
result = curlx_dyn_add(&enc, CONTENT_ENCODING_DEFAULT);
|
||||
|
||||
if(!result)
|
||||
return curlx_dyn_ptr(&enc);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue