mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 08:47:42 +08:00
make opt skip map a global
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
@ -23,6 +23,10 @@ const (
|
|||||||
ApiPath = "/api/v0" // TODO: make configurable
|
ApiPath = "/api/v0" // TODO: make configurable
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var OptionSkipMap = map[string]bool{
|
||||||
|
"api": true,
|
||||||
|
}
|
||||||
|
|
||||||
// Client is the commands HTTP client interface.
|
// Client is the commands HTTP client interface.
|
||||||
type Client interface {
|
type Client interface {
|
||||||
Send(req cmds.Request) (cmds.Response, error)
|
Send(req cmds.Request) (cmds.Response, error)
|
||||||
@ -141,13 +145,9 @@ func (c *client) Send(req cmds.Request) (cmds.Response, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getQuery(req cmds.Request) (string, error) {
|
func getQuery(req cmds.Request) (string, error) {
|
||||||
// some options should be kept clientside, the server doesnt care
|
|
||||||
skip := map[string]bool{
|
|
||||||
"api": true,
|
|
||||||
}
|
|
||||||
query := url.Values{}
|
query := url.Values{}
|
||||||
for k, v := range req.Options() {
|
for k, v := range req.Options() {
|
||||||
if skip[k] {
|
if OptionSkipMap[k] {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
str := fmt.Sprintf("%v", v)
|
str := fmt.Sprintf("%v", v)
|
||||||
|
Reference in New Issue
Block a user