diff --git a/pkg/agent/storage/https.go b/pkg/agent/storage/https.go index cf6bf608d00..39266138169 100644 --- a/pkg/agent/storage/https.go +++ b/pkg/agent/storage/https.go @@ -142,6 +142,7 @@ func (h *HTTPSDownloader) extractHeaders() (headers map[string]string, err error } func createNewFile(fileFullName string) (*os.File, error) { + fileFullName = filepath.Clean(fileFullName) if FileExists(fileFullName) { if err := os.Remove(fileFullName); err != nil { return nil, fmt.Errorf("file is unable to be deleted: %w", err)