aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/http/request.go
diff options
context:
space:
mode:
authorDavid Symonds <dsymonds@golang.org>2009-06-24 19:02:29 -0700
committerDavid Symonds <dsymonds@golang.org>2009-06-24 19:02:29 -0700
commit30533d607a3e10ae1a688ea88ee5976115681cba (patch)
treec423ba821d41ea2d673a7420ecf7c082aa827863 /src/pkg/http/request.go
parent466dd8da4ebe07a78bac55bba4e640e516eca5d4 (diff)
downloadgo-30533d607a3e10ae1a688ea88ee5976115681cba.tar.xz
Change strings.Split, bytes.Split to take a maximum substring count argument.
R=rsc APPROVED=r DELTA=131 (39 added, 10 deleted, 82 changed) OCL=30669 CL=30723
Diffstat (limited to 'src/pkg/http/request.go')
-rw-r--r--src/pkg/http/request.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/http/request.go b/src/pkg/http/request.go
index b331eb0837..9051d4c43d 100644
--- a/src/pkg/http/request.go
+++ b/src/pkg/http/request.go
@@ -442,7 +442,7 @@ func ReadRequest(b *bufio.Reader) (req *Request, err os.Error) {
}
var f []string;
- if f = strings.Split(s, " "); len(f) != 3 {
+ if f = strings.Split(s, " ", 3); len(f) < 3 {
return nil, BadRequest
}
req.Method, req.RawUrl, req.Proto = f[0], f[1], f[2];
@@ -572,8 +572,8 @@ func ReadRequest(b *bufio.Reader) (req *Request, err os.Error) {
func parseForm(body string) (data map[string] *vector.StringVector, err os.Error) {
data = make(map[string] *vector.StringVector);
- for _, kv := range strings.Split(body, "&") {
- kvPair := strings.Split(kv, "=");
+ for _, kv := range strings.Split(body, "&", 0) {
+ kvPair := strings.Split(kv, "=", 2);
var key, value string;
var e os.Error;