How to set a request body payload limit (actix-web 4) #2722
-
This is how the code looked like with actix-web 3: let srv = HttpServer::new(move || {
App::new()
.wrap(NormalizeSlash)
.wrap(middleware::Logger::default())
.wrap(Cors::default())
.app_data(app_state.clone())
.app_data(web::PayloadConfig::new(1000000 * 250))
.app_data(web::Json::<ViewMultFeatureSamplesInput>::configure(|cfg| {
cfg.limit(1000000 * 25).error_handler(json_error_handler)
})) Taken from this github issue: #1469 How do you do this with actix-web 4? |
Beta Was this translation helpful? Give feedback.
Answered by
fakeshadow
Apr 6, 2022
Replies: 1 comment
-
https://docs.rs/actix-web/latest/actix_web/web/struct.JsonConfig.html You have to manually import the type now. This is one wrong cosmetic change that only break people code for no reason. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kpcyrd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://docs.rs/actix-web/latest/actix_web/web/struct.JsonConfig.html
You have to manually import the type now. This is one wrong cosmetic change that only break people code for no reason.