summaryrefslogtreecommitdiff
path: root/pkg/bindings/connection.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-12 22:43:59 +0100
committerGitHub <noreply@github.com>2020-02-12 22:43:59 +0100
commit2281cbdd6d5b1b7bca99a605ffc8625b6bee7eb3 (patch)
treedebc8c5cfa9a28393c0c13b4dd7e00f83f1fe5e1 /pkg/bindings/connection.go
parente74ad3596393a476b7e233da736a610ef19bc4a1 (diff)
parentad4a92c5e53f222bd99d2b55e175eef48d077cf4 (diff)
downloadpodman-2281cbdd6d5b1b7bca99a605ffc8625b6bee7eb3.tar.gz
podman-2281cbdd6d5b1b7bca99a605ffc8625b6bee7eb3.tar.bz2
podman-2281cbdd6d5b1b7bca99a605ffc8625b6bee7eb3.zip
Merge pull request #5171 from baude/apiv2cockpit2
Fix container filters
Diffstat (limited to 'pkg/bindings/connection.go')
-rw-r--r--pkg/bindings/connection.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/pkg/bindings/connection.go b/pkg/bindings/connection.go
index 116af9709..f270060a6 100644
--- a/pkg/bindings/connection.go
+++ b/pkg/bindings/connection.go
@@ -130,7 +130,7 @@ func (c *Connection) DoRequest(httpBody io.Reader, httpMethod, endpoint string,
// 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, url.QueryEscape(v))
+ r.Add(k, v)
}
req.URL.RawQuery = r.Encode()
}
@@ -155,18 +155,14 @@ func GetConnectionFromContext(ctx context.Context) (*Connection, error) {
return conn, nil
}
-// FiltersToHTML converts our typical filter format of a
+// FiltersToString converts our typical filter format of a
// map[string][]string to a query/html safe string.
-func FiltersToHTML(filters map[string][]string) (string, error) {
+func FiltersToString(filters map[string][]string) (string, error) {
lowerCaseKeys := make(map[string][]string)
for k, v := range filters {
lowerCaseKeys[strings.ToLower(k)] = v
}
- unsafeString, err := jsoniter.MarshalToString(lowerCaseKeys)
- if err != nil {
- return "", err
- }
- return url.QueryEscape(unsafeString), nil
+ return jsoniter.MarshalToString(lowerCaseKeys)
}
// IsInformation returns true if the response code is 1xx