fix: increase middleware body size limit to 500MB for PDF uploads

Next.js 16 truncates request bodies at 10MB in middleware layer,
causing ECONNRESET for large PDF uploads. Set middlewareClientMaxBodySize
to 500mb to allow large file uploads to reach the route handlers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
AI Assistant
2026-03-13 19:23:06 +02:00
parent f032cf0e4a
commit e070aedae5
+4
View File
@@ -2,6 +2,10 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: 'standalone',
serverExternalPackages: ['busboy'],
experimental: {
middlewareClientMaxBodySize: '500mb',
},
};
export default nextConfig;