Enlarge web body input size from 1KiB to 1MiB

This commit is contained in:
Tobie Morgan Hitchcock 2021-05-24 09:22:41 +01:00
parent 74d8a36056
commit 469de77609
5 changed files with 8 additions and 8 deletions

View file

@ -9,7 +9,7 @@ pub fn config() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejecti
// Set post method // Set post method
let post = base let post = base
.and(warp::post()) .and(warp::post())
.and(warp::body::content_length_limit(1024 * 1024 * 1024)) // 1GiB .and(warp::body::content_length_limit(1024 * 1024 * 1024 * 1)) // 1GiB
.and_then(handler); .and_then(handler);
// Specify route // Specify route
opts.or(post) opts.or(post)

View file

@ -27,7 +27,7 @@ pub fn config() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejecti
// Set create method // Set create method
let create = base let create = base
.and(warp::post()) .and(warp::post())
.and(warp::body::content_length_limit(1024 * 1)) // 1MiB .and(warp::body::content_length_limit(1024 * 1024 * 1)) // 1MiB
.and(warp::body::bytes()) .and(warp::body::bytes())
.and_then(create_all); .and_then(create_all);
// Set delete method // Set delete method
@ -46,19 +46,19 @@ pub fn config() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejecti
// Set create method // Set create method
let create = base let create = base
.and(warp::post()) .and(warp::post())
.and(warp::body::content_length_limit(1024 * 1)) // 1MiB .and(warp::body::content_length_limit(1024 * 1024 * 1)) // 1MiB
.and(warp::body::bytes()) .and(warp::body::bytes())
.and_then(create_one); .and_then(create_one);
// Set update method // Set update method
let update = base let update = base
.and(warp::put()) .and(warp::put())
.and(warp::body::content_length_limit(1024 * 1)) // 1MiB .and(warp::body::content_length_limit(1024 * 1024 * 1)) // 1MiB
.and(warp::body::bytes()) .and(warp::body::bytes())
.and_then(update_one); .and_then(update_one);
// Set modify method // Set modify method
let modify = base let modify = base
.and(warp::patch()) .and(warp::patch())
.and(warp::body::content_length_limit(1024 * 1)) // 1MiB .and(warp::body::content_length_limit(1024 * 1024 * 1)) // 1MiB
.and(warp::body::bytes()) .and(warp::body::bytes())
.and_then(modify_one); .and_then(modify_one);
// Set delete method // Set delete method

View file

@ -10,7 +10,7 @@ pub fn config() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejecti
// Set post method // Set post method
let post = base let post = base
.and(warp::post()) .and(warp::post())
.and(warp::body::content_length_limit(1024 * 1)) // 1MiB .and(warp::body::content_length_limit(1024 * 1024 * 1)) // 1MiB
.and_then(handler); .and_then(handler);
// Specify route // Specify route
opts.or(post).with(head::cors()) opts.or(post).with(head::cors())

View file

@ -10,7 +10,7 @@ pub fn config() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejecti
// Set post method // Set post method
let post = base let post = base
.and(warp::post()) .and(warp::post())
.and(warp::body::content_length_limit(1024 * 1)) // 1MiB .and(warp::body::content_length_limit(1024 * 1024 * 1)) // 1MiB
.and_then(handler); .and_then(handler);
// Specify route // Specify route
opts.or(post).with(head::cors()) opts.or(post).with(head::cors())

View file

@ -11,7 +11,7 @@ pub fn config() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejecti
let post = base let post = base
.and(warp::post()) .and(warp::post())
.and(warp::header::<String>(http::header::CONTENT_TYPE.as_str())) .and(warp::header::<String>(http::header::CONTENT_TYPE.as_str()))
.and(warp::body::content_length_limit(1024 * 1)) // 1MiB .and(warp::body::content_length_limit(1024 * 1024 * 1)) // 1MiB
.and(warp::body::bytes()) .and(warp::body::bytes())
.and_then(handler); .and_then(handler);
// Set sock method // Set sock method