mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-25 05:00:07 +00:00
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) <noreply@anthropic.com>
This commit is contained in:
+3
-2
@@ -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" });
|
||||
|
||||
Reference in New Issue
Block a user