mirror of https://github.com/perkeep/perkeep.git
simplify code using newer Go APIs
Change-Id: I2425102367c4842e2b4a065f2e993ca9151bf9cc
This commit is contained in:
parent
1b63c44b4e
commit
420dccdd10
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue