From 2be00e2a7886bcfe12d25615faac57e311e4eccd Mon Sep 17 00:00:00 2001 From: Delcado19 <85063283+Delcado19@users.noreply.github.com> Date: Sat, 6 Jun 2026 12:34:43 +0700 Subject: [PATCH] fix(proxy): raise Next client body limit to 128MB (configurable) Avoid 10MB truncation of large /v1 payloads via NINEROUTER_PROXY_CLIENT_MAX_BODY_SIZE (#1529, #1572) Co-authored-by: Cursor --- next.config.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/next.config.mjs b/next.config.mjs index 85c7a258..3853b4b0 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -7,6 +7,7 @@ const projectRoot = dirname(fileURLToPath(import.meta.url)); const tracingRoot = process.env.NEXT_TRACING_ROOT_MODE === "workspace" ? join(projectRoot, "..") : projectRoot; +const proxyClientMaxBodySize = process.env.NINEROUTER_PROXY_CLIENT_MAX_BODY_SIZE || "128mb"; /** @type {import('next').NextConfig} */ const nextConfig = { @@ -24,6 +25,10 @@ const nextConfig = { unoptimized: true }, env: {}, + experimental: { + // #1529/#1572: LLM clients can send long context or base64 image payloads through /v1 rewrites. + proxyClientMaxBodySize, + }, webpack: (config, { isServer }) => { // Ignore fs/path modules in browser bundle if (!isServer) {