@cryptotaxi247 / kubo / commits / 8711c6635

make opt skip map a global

License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>

Jeromy committed Dec 28, 2015 at 05:47 UTC 8711c6635d3199f07eef9d6880738e48cea70e02
1 file changed +5 -5
commands/http/client.go
+5 -5
@@ -23,6 +23,10 @@ const (
23 ApiPath = "/api/v0" // TODO: make configurable
24 )
25
26 +var OptionSkipMap = map[string]bool{
27 + "api": true,
28 +}
29 +
30 // Client is the commands HTTP client interface.
31 type Client interface {
32 Send(req cmds.Request) (cmds.Response, error)
@@ -141,13 +145,9 @@ func (c *client) Send(req cmds.Request) (cmds.Response, error) {
145 }
146
147 func getQuery(req cmds.Request) (string, error) {
144 - // some options should be kept clientside, the server doesnt care
145 - skip := map[string]bool{
146 - "api": true,
147 - }
148 query := url.Values{}
149 for k, v := range req.Options() {
150 - if skip[k] {
150 + if OptionSkipMap[k] {
151 continue
152 }
153 str := fmt.Sprintf("%v", v)