simplify code using newer Go APIs

Change-Id: I2425102367c4842e2b4a065f2e993ca9151bf9cc
This commit is contained in:
Brad Fitzpatrick 2012-05-13 12:13:58 -07:00
parent 1b63c44b4e
commit 420dccdd10
1 changed files with 1 additions and 11 deletions

View File

@ -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 {