PreventOverwrite
This commit is contained in:
@@ -55,7 +55,8 @@ namespace Musify.Infrastructure.Services
|
||||
string key,
|
||||
string contentType,
|
||||
TimeSpan expirationTime,
|
||||
CancellationToken cancellationToken)
|
||||
CancellationToken cancellationToken,
|
||||
bool preventOverwrite = true)
|
||||
{
|
||||
var request = new GetPreSignedUrlRequest
|
||||
{
|
||||
@@ -67,6 +68,9 @@ namespace Musify.Infrastructure.Services
|
||||
ContentType = contentType
|
||||
};
|
||||
|
||||
if (preventOverwrite)
|
||||
request.Headers["If-None-Match"] = "*";
|
||||
|
||||
logger.LogDebug("Generating pre-signed upload URL for {Bucket}/{Key}", bucket, key);
|
||||
return await amazonS3.GetPreSignedURLAsync(request);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user