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

no ParseMultipartForm error return in formBinding #1738

Closed
w3xse7en opened this issue Jan 9, 2019 · 1 comment
Closed

no ParseMultipartForm error return in formBinding #1738

w3xse7en opened this issue Jan 9, 2019 · 1 comment

Comments

@w3xse7en
Copy link

w3xse7en commented Jan 9, 2019

  • go version: go1.11.2 windows/amd64
  • gin version (or commit ref): master branch
  • operating system: win10 17763

Description

gin/binding/form.go

func (formBinding) Bind(req *http.Request, obj interface{}) error {
	if err := req.ParseForm(); err != nil {
		return err
	}
	req.ParseMultipartForm(defaultMemory)
	if err := mapForm(obj, req.Form); err != nil {
		return err
	}
	return validate(obj)
}

req.ParseMultipartForm(defaultMemory) should return error

@vkd
Copy link
Contributor

vkd commented Jan 9, 2019

As I see, should return error except one - http.ErrNotMultipart.
Because formBinding used not only for multipart form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants