aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/http/request.go
diff options
context:
space:
mode:
authorBill Neubauer <wcn@golang.org>2009-10-03 11:09:01 -0700
committerBill Neubauer <wcn@golang.org>2009-10-03 11:09:01 -0700
commit41a2b21f2606ea9568f375beb9c5d517107e6dfa (patch)
treea53cea1fe1767a3e6a168356f55f742aec9a5725 /src/pkg/http/request.go
parent11d380557949c454fcda1f4b7909d4de2556d0e2 (diff)
downloadgo-41a2b21f2606ea9568f375beb9c5d517107e6dfa.tar.xz
Fixing HTTP POST handling to work with Chrome and Safari.
request.go does not handle Content-Type correctly for the definition of Media Types. http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 R=rsc APPROVED=rsc DELTA=44 (42 added, 0 deleted, 2 changed) OCL=35274 CL=35306
Diffstat (limited to 'src/pkg/http/request.go')
-rw-r--r--src/pkg/http/request.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/http/request.go b/src/pkg/http/request.go
index 2b425b7322..7ca7f0dc6c 100644
--- a/src/pkg/http/request.go
+++ b/src/pkg/http/request.go
@@ -627,7 +627,7 @@ func (r *Request) ParseForm() (err os.Error) {
return os.ErrorString("missing form body")
}
ct, _ := r.Header["Content-Type"];
- switch ct {
+ switch strings.Split(ct, ";", 2)[0] {
case "text/plain", "application/x-www-form-urlencoded", "":
var b []byte;
if b, err = io.ReadAll(r.Body); err != nil {