s3: fix uploads for legacy users

This commit is contained in:
Abdullah Atta
2025-10-22 10:13:51 +05:00
parent 75a4462fd1
commit 8bc1a52a60

View File

@@ -56,7 +56,11 @@ namespace Notesnook.API.Controllers
var fileSize = HttpContext.Request.ContentLength ?? 0;
bool hasBody = fileSize > 0;
if (!hasBody) return Ok(Request.GetEncodedUrl());
if (!hasBody)
{
return Ok(Request.GetEncodedUrl() + "&access_token=" + Request.Headers.Authorization.ToString().Replace("Bearer ", ""));
}
if (Constants.IS_SELF_HOSTED) await UploadFileAsync(userId, name, fileSize);
else await UploadFileWithChecksAsync(userId, name, fileSize);