Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,20 @@ func FetchBeatsBinary(artifactName string, artifact string, version string, fall
return filePath, err
}

binariesCache[URL] = filePath
// use artifact name as file name to avoid having URL params in the name
sanitizedFilePath := path.Join(path.Dir(filePath), artifactName)
err = os.Rename(filePath, sanitizedFilePath)
if err != nil {
log.WithFields(log.Fields{
"fileName": filePath,
"sanitizedFileName": sanitizedFilePath,
}).Warn("Could not sanitize downloaded file name. Keeping old name")
sanitizedFilePath = filePath
}

binariesCache[URL] = sanitizedFilePath

return filePath, nil
return sanitizedFilePath, nil
}

var downloadURL string
Expand Down