diff options
Diffstat (limited to 'libs/libcurl/src/headers.c')
-rw-r--r-- | libs/libcurl/src/headers.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libs/libcurl/src/headers.c b/libs/libcurl/src/headers.c index 1272979677..bcd65be503 100644 --- a/libs/libcurl/src/headers.c +++ b/libs/libcurl/src/headers.c @@ -300,9 +300,16 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header, if(data->state.prevhead)
/* line folding, append value to the previous header's value */
return unfold_value(data, header, hlen);
- else
- /* can't unfold without a previous header */
- return CURLE_BAD_FUNCTION_ARGUMENT;
+ else {
+ /* Can't unfold without a previous header. Instead of erroring, just
+ pass the leading blanks. */
+ while(hlen && ISBLANK(*header)) {
+ header++;
+ hlen--;
+ }
+ if(!hlen)
+ return CURLE_WEIRD_SERVER_REPLY;
+ }
}
hs = calloc(1, sizeof(*hs) + hlen);
|