Skip to content

Commit d77daa0

Browse files
committedFeb 6, 2024
fix: always b64encode the image when fetching results
1 parent 0edd8cf commit d77daa0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎jfrog/client.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package jfrog
22

33
import (
4+
"encoding/base64"
45
"encoding/json"
56
"fmt"
67
"net/http"
@@ -67,7 +68,8 @@ type SecurityIssues struct {
6768
}
6869

6970
func (c *client) ScanResults(img Image) (ScanResult, error) {
70-
path := fmt.Sprintf("%s/xray/api/v1/packages/%s/versions?search=%s", c.baseURL, img.Package, img.Version)
71+
b64str := base64.URLEncoding.EncodeToString([]byte(img.Package))
72+
path := fmt.Sprintf("%s/xray/api/v1/packages/%s/versions?search=%s&base64id=true", c.baseURL, b64str, img.Version)
7173
resp, body, _, err := c.client.SendGet(path, true, &httputils.HttpClientDetails{
7274
User: c.user,
7375
AccessToken: c.token,

0 commit comments

Comments
 (0)
Please sign in to comment.