Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formdata: use the mime-content type function #2282

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
2 participants
@bagder
Copy link
Member

commented Feb 4, 2018

Reduce code duplication by making Curl_mime_contenttype available and
used by the formdata function. This also makes the formdata function
recognize a set of more file extensions by default.

PR #2280 brought this to my attention.

formdata: use the mime-content type function
Reduce code duplication by making Curl_mime_contenttype available and
used by the formdata function. This also makes the formdata function
recognize a set of more file extensions by default.

PR #2280 brought this to my attention.
@@ -627,9 +573,14 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
!form->contenttype) {
char *f = form->flags & HTTPPOST_BUFFER?
form->showfilename : form->value;
char const *type = prevtype;
if(!type)

This comment has been minimized.

Copy link
@monnerat

monnerat Feb 5, 2018

Collaborator

To stay compatible, prevtype should be used only if Curl_mime_contenttype(f) return NULL.

This comment has been minimized.

Copy link
@bagder

bagder Feb 5, 2018

Author Member

Oops, you're right. Thanks. I'll fix!

@bagder bagder closed this in 84ad1fd Feb 5, 2018

@bagder bagder deleted the bagder/mime-contenttype branch Feb 9, 2018

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.