Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/net/http/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ func (r *Request) multipartReader(allowMixed bool) (*multipart.Reader, error) {
if v == "" {
return nil, ErrNotMultipart
}
if r.Body == nil {
if r.Body == nil || r.Body == NoBody {
return nil, errors.New("missing form body")
}
d, params, err := mime.ParseMediaType(v)
Expand Down Expand Up @@ -1261,7 +1261,7 @@ func copyValues(dst, src url.Values) {
}

func parsePostForm(r *Request) (vs url.Values, err error) {
if r.Body == nil {
if r.Body == nil || r.Body == NoBody {
err = errors.New("missing form body")
return
}
Expand Down