http: only recognize application/x-www-form-urlencoded in ParseForm

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5322070
This commit is contained in:
Brad Fitzpatrick 2011-11-03 17:21:58 -07:00
parent 54049767ae
commit a494c20032
2 changed files with 7 additions and 14 deletions

View file

@ -734,7 +734,7 @@ func (r *Request) ParseForm() (err error) {
ct := r.Header.Get("Content-Type")
ct, _, err := mime.ParseMediaType(ct)
switch {
case ct == "text/plain" || ct == "application/x-www-form-urlencoded" || ct == "":
case ct == "application/x-www-form-urlencoded":
var reader io.Reader = r.Body
maxFormSize := int64(1<<63 - 1)
if _, ok := r.Body.(*maxBytesReader); !ok {