security: Update go-uuid and mholt/archiver to recommended version (#2216)
* security: Update go-uuid to recommended version * security: Update mholt/archiver dep to recommended version Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -107,7 +107,11 @@ func DownloadToTempFile(fileUrl string) (string, error) {
|
||||
return "", errors.Wrapf(err, "error creating temp directory %v", tmpDir)
|
||||
}
|
||||
|
||||
tmpFilename := uuid.NewV4().String()
|
||||
id, err := uuid.NewV4()
|
||||
if err != nil {
|
||||
return "", errors.Wrapf(err, "error generating UUID")
|
||||
}
|
||||
tmpFilename := id.String()
|
||||
destination := filepath.Join(tmpDir, tmpFilename)
|
||||
|
||||
err = WriteArchiveToFile(destination, reader)
|
||||
@@ -135,7 +139,11 @@ func WriteArchiveToFile(fileName string, reader io.Reader) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tmpFileName := uuid.NewV4().String()
|
||||
id, err := uuid.NewV4()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tmpFileName := id.String()
|
||||
|
||||
path := filepath.Join(tmpDir, tmpFileName+".tmp")
|
||||
w, err := os.Create(path)
|
||||
|
||||
Reference in New Issue
Block a user