fix: increase request body size limit to 500MB for video uploads
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
4e42b3e1c1
commit
db070f8a37
@ -279,9 +279,7 @@ export async function POST(request: NextRequest) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 配置较大的请求体限制
|
// App Router 配置:增加请求体大小限制
|
||||||
export const config = {
|
// 参考: https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
|
||||||
api: {
|
export const maxDuration = 300; // 5分钟超时
|
||||||
bodyParser: false,
|
export const dynamic = "force-dynamic";
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|||||||
@ -6,6 +6,16 @@ const nextConfig: NextConfig = {
|
|||||||
typescript: {
|
typescript: {
|
||||||
ignoreBuildErrors: true, // 临时禁用类型检查以加快开发
|
ignoreBuildErrors: true, // 临时禁用类型检查以加快开发
|
||||||
},
|
},
|
||||||
|
// 增加请求体大小限制以支持大文件上传(视频等)
|
||||||
|
serverActions: {
|
||||||
|
bodySizeLimit: "500mb",
|
||||||
|
},
|
||||||
|
// 实验性功能:增加中间件和代理请求体大小限制
|
||||||
|
experimental: {
|
||||||
|
serverComponentsExternalPackages: ["sharp"],
|
||||||
|
middlewareClientMaxBodySize: "500mb", // 中间件请求体限制
|
||||||
|
proxyClientMaxBodySize: "500mb", // 代理请求体限制
|
||||||
|
},
|
||||||
images: {
|
images: {
|
||||||
remotePatterns: [
|
remotePatterns: [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user