summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-02-05 09:06:31 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-02-05 09:06:31 +0100
commit9fd43a236cfdde1e3f397d11d9b1a5f886605186 (patch)
tree31e2d053c836cf6bde3ae02a248e325a4c433bdf
parent3499f12b089da80854a2527eec679e1a38d2a874 (diff)
downloadcurl-bagder/mime-contenttype.tar.gz
fixup formdata: only use prevtype if Curl_mime_contenttype() is NULLbagder/mime-contenttype
-rw-r--r--lib/formdata.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index 274846724..f91241052 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -573,9 +573,10 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
!form->contenttype) {
char *f = form->flags & HTTPPOST_BUFFER?
form->showfilename : form->value;
- char const *type = prevtype;
+ char const *type;
+ type = Curl_mime_contenttype(f);
if(!type)
- type = Curl_mime_contenttype(f);
+ type = prevtype;
if(!type)
type = FILE_CONTENTTYPE_DEFAULT;