]> Cypherpunks repositories - gostls13.git/commit
net/http: Return ErrNotMultipart from ParseMultipartForm if content-type isn't multip...
authorMatthew Cottingham <mattcottingham@gmail.com>
Fri, 11 Apr 2014 05:50:04 +0000 (22:50 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 11 Apr 2014 05:50:04 +0000 (22:50 -0700)
commit8d1b63abff2c948741e94c92d2a9a60069a71ddb
treea2a6fe990eaea43876d6436fe8b18151c98f660f
parent10a273196b5aed2d72d50573bfc5c0bdb2e631a2
net/http: Return ErrNotMultipart from ParseMultipartForm if content-type isn't multipart/form-data.

Add test for multipart form requests with an invalid content-type to ensure
ErrNotMultipart is returned.

Change ParseMultipartForm to return ErrNotMultipart when it is returned by multipartReader.

Modify test for empty multipart request handling to use POST so that the body is checked.

Fixes #6334.

This is the first changeset working on multipart request handling. Further changesets
could add more tests and clean up the TODO.

LGTM=bradfitz
R=golang-codereviews, gobot, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/44040043
src/pkg/net/http/request.go
src/pkg/net/http/request_test.go