Skip to content

Commit

Permalink
fix: non md5 etags (#1952)
Browse files Browse the repository at this point in the history
* sha256 hash the etag
  • Loading branch information
niger-prequel committed Apr 19, 2024
1 parent 18e8073 commit e44abd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api-get-object-file.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (c *Client) FGetObject(ctx context.Context, bucketName, objectName, filePat
}

// Write to a temporary file "fileName.part.minio" before saving.
filePartPath := filePath + objectStat.ETag + ".part.minio"
filePartPath := filePath + sum256Hex([]byte(objectStat.ETag)) + ".part.minio"

// If exists, open in append mode. If not create it as a part file.
filePart, err := os.OpenFile(filePartPath, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0o600)
Expand Down

0 comments on commit e44abd3

Please sign in to comment.