mime: keep "text/plain" content type if user-specified.

Include test cases in 554, 587, 650.

Fixes https://github.com/curl/curl/issues/1986
This commit is contained in:
Patrick Monnerat 2017-10-12 19:36:16 +01:00
parent 56509055d2
commit 0401734dfd
7 changed files with 35 additions and 27 deletions

View file

@ -907,7 +907,7 @@ CURLcode Curl_getformdata(struct Curl_easy *data,
result = curl_mime_headers(part, file->contentheader, 0);
/* Set the content type. */
if(!result &&file->contenttype)
if(!result && file->contenttype)
result = curl_mime_type(part, file->contenttype);
/* Set field name. */