From 802aa5ae27ce755b94477976397502dc056227c4 Mon Sep 17 00:00:00 2001 From: Balazs Kovacsics Date: Mon, 22 Jul 2019 14:37:37 +0200 Subject: HTTP: use chunked Transfer-Encoding for HTTP_POST if size unknown If using the read callback for HTTP_POST, and POSTFIELDSIZE is not set, automatically add a Transfer-Encoding: chunked header, same as it is already done for HTTP_PUT, HTTP_POST_FORM and HTTP_POST_MIME. Update test 1514 according to the new behaviour. Closes #4138 --- lib/http.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/http.c') diff --git a/lib/http.c b/lib/http.c index 36e94f762..065a26817 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2247,8 +2247,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) else { if((conn->handler->protocol & PROTO_FAMILY_HTTP) && (((httpreq == HTTPREQ_POST_MIME || httpreq == HTTPREQ_POST_FORM) && - http->postsize < 0) || - (data->set.upload && data->state.infilesize == -1))) { + http->postsize < 0) || + ((data->set.upload || httpreq == HTTPREQ_POST) && + data->state.infilesize == -1))) { if(conn->bits.authneg) /* don't enable chunked during auth neg */ ; -- cgit v1.2.3