PreventOverwrite

This commit is contained in:
2026-05-28 21:04:09 +02:00
parent 94bf9c61a3
commit d35e8eb5f7
2 changed files with 7 additions and 5 deletions
+5 -1
View File
@@ -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);
}