Skip to content

Commit

Permalink
Use filepath.Base to sanitize path for archive downloads (#7805)
Browse files Browse the repository at this point in the history
  • Loading branch information
samcoe committed Aug 7, 2023
1 parent f777bec commit e0d2fc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/release/download/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func downloadAsset(dest *destinationWriter, httpClient *http.Client, assetURL, f
return fmt.Errorf("unable to parse file name of archive: %w", err)
}
if serverFileName, ok := params["filename"]; ok {
fileName = filepath.Clean(serverFileName)
fileName = filepath.Base(serverFileName)
} else {
return errors.New("unable to determine file name of archive")
}
Expand Down

0 comments on commit e0d2fc8

Please sign in to comment.