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
Closed

Conversation

@bagder
Copy link
Member

@bagder bagder 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.

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.
lib/formdata.c Outdated
@@ -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)
Copy link
Contributor

@monnerat monnerat Feb 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

@bagder bagder Feb 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants