From dfda7ba456f72576142d1dd3065d7c1a9a9858f3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 17 Feb 2002 14:42:44 +0000 Subject: corrected the Expect: ignore, made Content-Type: possible to skip --- lib/http.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/http.c b/lib/http.c index 07a202b96..e0d3cda9b 100644 --- a/lib/http.c +++ b/lib/http.c @@ -815,8 +815,6 @@ CURLcode Curl_http(struct connectdata *conn) } if(HTTPREQ_POST_FORM == data->set.httpreq) { - char contentType[256]; - int linelength=0; if(Curl_FormInit(&http->form, http->sendit)) { failf(data, "Internal HTTP POST error!"); return CURLE_HTTP_POST_ERROR; @@ -840,10 +838,19 @@ CURLcode Curl_http(struct connectdata *conn) add_bufferf(req_buffer, "Expect: 100-continue\r\n"); data->set.expect100header = TRUE; + } + if(!checkheaders(data, "Content-Type:")) { /* Get Content-Type: line from Curl_FormReadOneLine, which happens to always be the first line. We can know this for sure since - we always build the formpost linked list the same way! */ + we always build the formpost linked list the same way! + + The Content-Type header line also contains the MIME boundary + string etc why disabling this header is likely to not make things + work, but we support it anyway. + */ + char contentType[256]; + int linelength=0; linelength = Curl_FormReadOneLine (contentType, sizeof(contentType), 1, @@ -853,11 +860,11 @@ CURLcode Curl_http(struct connectdata *conn) return CURLE_HTTP_POST_ERROR; } add_buffer(req_buffer, contentType, linelength); - - /* make the request end in a true CRLF */ - add_buffer(req_buffer, "\r\n", 2); } + /* make the request end in a true CRLF */ + add_buffer(req_buffer, "\r\n", 2); + /* set upload size to the progress meter */ Curl_pgrsSetUploadSize(data, http->postsize); -- cgit v1.2.3