Skip to content

Commit

Permalink
fix: url escape results url (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreya authored Apr 19, 2024
1 parent cf5463f commit acda0a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jfrog/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"path/filepath"

"github.com/google/go-containerregistry/pkg/name"
Expand Down Expand Up @@ -103,7 +104,7 @@ type Image struct {
}

func (c *client) ResultsURL(img Image, packageID string) string {
return fmt.Sprintf("%s/ui/scans-list/packages-scans/%s/scan-descendants/%s?package_id=%s&version=%s", c.baseURL, img.Package, img.Version, packageID, img.Version)
return fmt.Sprintf("%s/ui/scans-list/packages-scans/%s/scan-descendants/%s?package_id=%s&version=%s", c.baseURL, url.PathEscape(img.Package), url.PathEscape(img.Version), url.QueryEscape(packageID), url.QueryEscape(img.Version))
}

func ParseImage(image string) (Image, error) {
Expand Down

0 comments on commit acda0a3

Please sign in to comment.