I've got problem with setting the payload limit in Actix. No matter how I try to configure it (with app_data, data, on service level etc) I always get 413 http response with body A payload reached size limit.
and following log: Error in response: Overflow
Here's the code
HttpServer::new(move || {
App::new()
.data(app_config.clone())
.app_data(web::PayloadConfig::new(50_242_880))
.data(Client::new())
.wrap(middleware::Logger::default())
.route("/{path:.*}", web::get().to(proxy))
}).bind(server_address)
?.run()
.await
where proxy is:
pub async fn proxy(
original_request: HttpRequest,
body: Option<web::Bytes>,
client: web::Data<Client>,
app_config: web::Data<AppConfig>
) -> Result<HttpResponse, Error> {
I've also tried to set other configs e.g.
.app_data(web::JsonConfig::default().limit(5_242_880))
.app_data(actix_web::web::Bytes::configure(|cfg| {
cfg.limit(5_242_880)
}))
but it didn't work either