From d1e6f9c18dde6a02df3cf7030608e3338084fe4e Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Fri, 3 Apr 2026 15:09:44 +0200 Subject: [PATCH] fix session report submission: raise body size limit from 1 MB to 20 MB Reports with screenshots and agent logs easily exceed 1 MB after base64 encoding. 20 MB accommodates 5 MB agent logs (~6.7 MB base64) plus multi-MB screenshots plus CSV/TXT exports. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../Functions/Reports/SubmitSessionReportFunction.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Backend/AutopilotMonitor.Functions/Functions/Reports/SubmitSessionReportFunction.cs b/src/Backend/AutopilotMonitor.Functions/Functions/Reports/SubmitSessionReportFunction.cs index 21b496a6..f47f5e5e 100644 --- a/src/Backend/AutopilotMonitor.Functions/Functions/Reports/SubmitSessionReportFunction.cs +++ b/src/Backend/AutopilotMonitor.Functions/Functions/Reports/SubmitSessionReportFunction.cs @@ -45,10 +45,11 @@ namespace AutopilotMonitor.Functions.Functions.Reports var tenantId = requestCtx.TenantId; var userIdentifier = requestCtx.UserPrincipalName; - // Request body size limit (1 MB) + // Request body size limit (20 MB — must accommodate base64-encoded agent logs, + // screenshots, plus CSV/TXT exports; base64 adds ~33% overhead) if (req.Headers.TryGetValues("Content-Length", out var clValues) && long.TryParse(clValues.FirstOrDefault(), out var contentLength) - && contentLength > 1_048_576) + && contentLength > 20_971_520) { var tooLarge = req.CreateResponse(HttpStatusCode.BadRequest); await tooLarge.WriteAsJsonAsync(new { success = false, message = "Request body too large" });