mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
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 <cursoragent@cursor.com>
This commit is contained in:
committed by
decolua
co-authored by
Cursor
parent
4fc02e67e5
commit
2be00e2a78
@@ -7,6 +7,7 @@ const projectRoot = dirname(fileURLToPath(import.meta.url));
|
|||||||
const tracingRoot = process.env.NEXT_TRACING_ROOT_MODE === "workspace"
|
const tracingRoot = process.env.NEXT_TRACING_ROOT_MODE === "workspace"
|
||||||
? join(projectRoot, "..")
|
? join(projectRoot, "..")
|
||||||
: projectRoot;
|
: projectRoot;
|
||||||
|
const proxyClientMaxBodySize = process.env.NINEROUTER_PROXY_CLIENT_MAX_BODY_SIZE || "128mb";
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
@@ -24,6 +25,10 @@ const nextConfig = {
|
|||||||
unoptimized: true
|
unoptimized: true
|
||||||
},
|
},
|
||||||
env: {},
|
env: {},
|
||||||
|
experimental: {
|
||||||
|
// #1529/#1572: LLM clients can send long context or base64 image payloads through /v1 rewrites.
|
||||||
|
proxyClientMaxBodySize,
|
||||||
|
},
|
||||||
webpack: (config, { isServer }) => {
|
webpack: (config, { isServer }) => {
|
||||||
// Ignore fs/path modules in browser bundle
|
// Ignore fs/path modules in browser bundle
|
||||||
if (!isServer) {
|
if (!isServer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user