mirror of
https://github.com/curl/curl.git
synced 2026-08-25 00:33:31 +03:00
http: fix for unfolding line starting with TAB
It should still insert a (single) space when unfolding Follow-up to9941e7c95bfollowing up to67ae101666. Updated test 1274 and 1940 accordingly. Closes #20029
This commit is contained in:
parent
481f11d96f
commit
6c7bc9871f
4 changed files with 13 additions and 7 deletions
11
lib/http.c
11
lib/http.c
|
|
@ -4391,19 +4391,16 @@ static CURLcode http_parse_headers(struct Curl_easy *data,
|
|||
|
||||
if(data->state.leading_unfold) {
|
||||
/* immediately after an unfold, keep only a single whitespace */
|
||||
const size_t iblen = blen;
|
||||
while(consumed && ISBLANK(buf[0])) {
|
||||
consumed--;
|
||||
buf++;
|
||||
blen--;
|
||||
}
|
||||
if(consumed) {
|
||||
if(iblen > blen) {
|
||||
/* take one step back */
|
||||
consumed++;
|
||||
buf--;
|
||||
blen++;
|
||||
}
|
||||
/* insert a single space */
|
||||
result = curlx_dyn_addn(&data->state.headerb, " ", 1);
|
||||
if(result)
|
||||
return result;
|
||||
data->state.leading_unfold = FALSE; /* done now */
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue