mirror of
https://github.com/curl/curl.git
synced 2026-07-27 06:47:16 +03:00
http: restore header folding behavior
Folded header lines will now get passed through like before. The headers API is adapted and will provide the content unfolded. Added test 1274 and extended test 1940 to verify. Reported-by: Petr Pisar Fixes #8844 Closes #8899
This commit is contained in:
parent
16a58e9f93
commit
c9b60f0053
8 changed files with 139 additions and 9 deletions
15
lib/http.c
15
lib/http.c
|
|
@ -3799,11 +3799,16 @@ static CURLcode verify_header(struct Curl_easy *data)
|
|||
if(k->headerline < 2)
|
||||
/* the first "header" is the status-line and it has no colon */
|
||||
return CURLE_OK;
|
||||
ptr = memchr(header, ':', hlen);
|
||||
if(!ptr) {
|
||||
/* this is bad, bail out */
|
||||
failf(data, "Header without colon");
|
||||
return CURLE_WEIRD_SERVER_REPLY;
|
||||
if(((header[0] == ' ') || (header[0] == '\t')) && k->headerline > 2)
|
||||
/* line folding, can't happen on line 2 */
|
||||
;
|
||||
else {
|
||||
ptr = memchr(header, ':', hlen);
|
||||
if(!ptr) {
|
||||
/* this is bad, bail out */
|
||||
failf(data, "Header without colon");
|
||||
return CURLE_WEIRD_SERVER_REPLY;
|
||||
}
|
||||
}
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue