fix: raise Express JSON body limit to 25mb for OCR image payloads

Default 100kb limit rejected base64-encoded scanned page images
with 413 Payload Too Large, breaking /documents/ocr-image for any
realistic scan.
This commit is contained in:
mstfyldz
2026-08-11 10:50:58 +03:00
parent a6c1eabaad
commit 8065df4ff0
+4 -1
View File
@@ -17,7 +17,10 @@ const limiter = rateLimit({
}); });
app.use(cors()); app.use(cors());
app.use(express.json()); // Varsayılan limit (100kb) OCR için gönderilen base64 taranmış sayfa görsellerini
// (300KB-1MB+ ham, base64 ile ~%33 daha büyük) kolayca aşıyordu ve 413 Payload
// Too Large ile reddediliyordu — bkz. /documents/ocr-image.
app.use(express.json({ limit: '25mb' }));
// If your app is behind a proxy (like Nginx, Docker ingress, etc.), // If your app is behind a proxy (like Nginx, Docker ingress, etc.),
// the IP will default to the proxy's IP. We set trust proxy to get the real client IP. // the IP will default to the proxy's IP. We set trust proxy to get the real client IP.