diff options
author | Brent Baude <bbaude@redhat.com> | 2020-02-21 12:32:42 -0600 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-02-21 16:11:39 -0600 |
commit | f0df07b5931b256b0ddadb80a8357985038cfe26 (patch) | |
tree | 5bc5132d488fe285d64d6b517d587a8c68ea38cd /pkg/bindings/connection.go | |
parent | f51cf8546d17c68f5ade1b4c8558d120c583316e (diff) | |
download | podman-f0df07b5931b256b0ddadb80a8357985038cfe26.tar.gz podman-f0df07b5931b256b0ddadb80a8357985038cfe26.tar.bz2 podman-f0df07b5931b256b0ddadb80a8357985038cfe26.zip |
add more image tests for go bindings
adding more image tests for go bindings. one big change is that the params were converted from map[string]string to url.values to account for the ability to send []string as query params
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings/connection.go')
-rw-r--r-- | pkg/bindings/connection.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/pkg/bindings/connection.go b/pkg/bindings/connection.go index 75f1fc6a5..ba5f9c3aa 100644 --- a/pkg/bindings/connection.go +++ b/pkg/bindings/connection.go @@ -206,7 +206,7 @@ func unixClient(_url *url.URL) (*http.Client, error) { } // DoRequest assembles the http request and returns the response -func (c *Connection) DoRequest(httpBody io.Reader, httpMethod, endpoint string, queryParams map[string]string, pathValues ...string) (*APIResponse, error) { +func (c *Connection) DoRequest(httpBody io.Reader, httpMethod, endpoint string, queryParams url.Values, pathValues ...string) (*APIResponse, error) { var ( err error response *http.Response @@ -225,12 +225,7 @@ func (c *Connection) DoRequest(httpBody io.Reader, httpMethod, endpoint string, return nil, err } if len(queryParams) > 0 { - // if more desirable we could use url to form the encoded endpoint with params - r := req.URL.Query() - for k, v := range queryParams { - r.Add(k, v) - } - req.URL.RawQuery = r.Encode() + req.URL.RawQuery = queryParams.Encode() } // Give the Do three chances in the case of a comm/service hiccup for i := 0; i < 3; i++ { |