Skip to content

Commit

Permalink
fix(plugin): do not call GitHub content API for releases and tags (aq…
Browse files Browse the repository at this point in the history
…uasecurity#7274)

Signed-off-by: knqyf263 <[email protected]>
  • Loading branch information
knqyf263 authored Jul 31, 2024
1 parent 35c60f0 commit b3ee6da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/downloader/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ func (t *CustomTransport) RoundTrip(req *http.Request) (*http.Response, error) {
func NewGitHubTransport(u *url.URL, insecure bool, token string) http.RoundTripper {
client := newGitHubClient(insecure, token)
ss := strings.SplitN(u.Path, "/", 4)
if len(ss) < 4 || strings.HasPrefix(ss[3], "archive/") {
if len(ss) < 4 || strings.HasPrefix(ss[3], "archive/") || strings.HasPrefix(ss[3], "releases/") ||
strings.HasPrefix(ss[3], "tags/") {
// Use the default transport from go-github for authentication
return client.Client().Transport
}
Expand Down

0 comments on commit b3ee6da

Please sign in to comment.