Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rust-version = "1.86"
axum = { version = "0.7", features = ["macros"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time", "signal"] }
tower = { version = "0.5", features = ["util"] }
tower-http = { version = "0.5", features = ["cors", "fs", "trace"] }
tower-http = { version = "0.5", features = ["cors", "fs", "trace", "limit"] }
hyper = { version = "1.0", features = ["full"] }

# HTTP 客户端(上游转发)
Expand Down
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ async fn main() -> anyhow::Result<()> {
let state = routes::AppState::new(conn, cfg, crypto);
let app = routes::router()
.with_state(state)
// 请求体上限:axum 默认 2MB,对超长 LLM 上下文/图片 base64 不够,放宽到 70MB
//(rant 2026-08-22T23:20:00;真实限制仍由上游模型 context 窗口裁决)
.layer(tower_http::limit::RequestBodyLimitLayer::new(
70 * 1024 * 1024,
))
.layer(tower_http::trace::TraceLayer::new_for_http());

let listener = tokio::net::TcpListener::bind(&addr).await?;
Expand Down
Loading