Skip to content

Commit

Permalink
Update nocache condition
Browse files Browse the repository at this point in the history
Signed-off-by: Raghav Kaul <[email protected]>
  • Loading branch information
raghavkaul committed Nov 16, 2023
1 parent 215510e commit 6e38313
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/ghclients/memorycache.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ func (c *memoryCache) Get(key string) (resp []byte, ok bool) {

// Set saves response resp to the cache with key
func (c *memoryCache) Set(key string, resp []byte) {
if strings.Contains(key, ".tar.gz") {
if strings.Contains(key, ".tar.gz") || strings.Contains(key, "tarball/") {
// Don't cache tarballs. Currently GitHub redirects tarball downloads to a
// URL that looks like this:
// "https://codeload.github.com/<owner>/<repo>/legacy.tar.gz/refs/heads/main"
// Scorecard requests tarballs that look like:
// "https://api.github.com/repos/<owner>/<repo>/tarball/"
// Hopefully this continues to have ".tar.gz" in it.
return
}
Expand Down

0 comments on commit 6e38313

Please sign in to comment.