Skip to content

Commit c813193

Browse files
committed
Query escape parameters to url in avi client
Signed-off-by: Christian Ang <[email protected]>
1 parent c80096d commit c813193

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/aviclient/client.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"crypto/x509"
1212
"encoding/json"
1313
"net/http"
14+
"net/url"
1415
"regexp"
1516
"strings"
1617

@@ -190,7 +191,7 @@ func (r *realAviClient) GetControllerVersion() (string, error) {
190191
}
191192

192193
func (r *realAviClient) GetObjectByName(obj string, name string, cloudName string, result interface{}, options ...session.ApiOptionsParams) error {
193-
uri := "/api/" + obj + "/?include_name&name=" + name + "&cloud_ref.name=" + cloudName
194+
uri := "/api/" + obj + "/?include_name&name=" + url.QueryEscape(name) + "&cloud_ref.name=" + url.QueryEscape(cloudName)
194195
res, err := r.AviSession.GetCollectionRaw(uri, options...)
195196
if err != nil {
196197
return err

0 commit comments

Comments
 (0)