fix(proxy): increase request body size limit to 200MB

Fixes #666
This commit is contained in:
YoVinchen
2026-01-17 03:34:07 +08:00
committed by Jason
parent 74f67bc1ee
commit 924e5386f9
+3
View File
@@ -8,6 +8,7 @@ use super::{
};
use crate::database::Database;
use axum::{
extract::DefaultBodyLimit,
routing::{get, post},
Router,
};
@@ -224,6 +225,8 @@ impl ProxyServer {
// Gemini API (支持带前缀和不带前缀)
.route("/v1beta/*path", post(handlers::handle_gemini))
.route("/gemini/v1beta/*path", post(handlers::handle_gemini))
// 提高默认请求体大小限制(避免 413 Payload Too Large
.layer(DefaultBodyLimit::max(200 * 1024 * 1024))
.layer(cors)
.with_state(self.state.clone())
}