From 420dccdd107fa73d7de7c033874f7dfb8cc1893f Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sun, 13 May 2012 12:13:58 -0700 Subject: [PATCH] simplify code using newer Go APIs Change-Id: I2425102367c4842e2b4a065f2e993ca9151bf9cc --- pkg/server/ui.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pkg/server/ui.go b/pkg/server/ui.go index 195302def..02bff1675 100644 --- a/pkg/server/ui.go +++ b/pkg/server/ui.go @@ -21,7 +21,6 @@ import ( "fmt" "log" "net/http" - "net/url" "regexp" "strconv" "strings" @@ -149,16 +148,7 @@ func newUiFromConfig(ld blobserver.Loader, conf jsonconfig.Obj) (h http.Handler, } func camliMode(req *http.Request) string { - // TODO-GO: this is too hard to get at the GET Query args on a - // POST request. - m, err := url.ParseQuery(req.URL.RawQuery) - if err != nil { - return "" - } - if mode, ok := m["camli.mode"]; ok && len(mode) > 0 { - return mode[0] - } - return "" + return req.URL.Query().Get("camli.mode") } func wantsDiscovery(req *http.Request) bool {