From 8bc1a52a601bf83e132602a55af13cc00b5e8c20 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Wed, 22 Oct 2025 10:13:51 +0500 Subject: [PATCH] s3: fix uploads for legacy users --- Notesnook.API/Controllers/S3Controller.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Notesnook.API/Controllers/S3Controller.cs b/Notesnook.API/Controllers/S3Controller.cs index 90bf2f1..c124375 100644 --- a/Notesnook.API/Controllers/S3Controller.cs +++ b/Notesnook.API/Controllers/S3Controller.cs @@ -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);