aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-02-17 14:42:44 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-02-17 14:42:44 +0000
commitdfda7ba456f72576142d1dd3065d7c1a9a9858f3 (patch)
tree457c1a11a6bbce9b253e76939a707e5800deafc2
parentfeb6b6445ee7ad619dbae742b3f81ebe4011faa6 (diff)
corrected the Expect: ignore, made Content-Type: possible to skip
-rw-r--r--lib/http.c19
1 files 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);