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
let post = base
.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);
// Specify route
opts.or(post)

View file

@ -27,7 +27,7 @@ pub fn config() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejecti
// Set create method
let create = base
.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_then(create_all);
// Set delete method
@ -46,19 +46,19 @@ pub fn config() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejecti
// Set create method
let create = base
.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_then(create_one);
// Set update method
let update = base
.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_then(update_one);
// Set modify method
let modify = base
.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_then(modify_one);
// Set delete method

View file

@ -10,7 +10,7 @@ pub fn config() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejecti
// Set post method
let post = base
.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);
// Specify route
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
let post = base
.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);
// Specify route
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
.and(warp::post())
.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_then(handler);
// Set sock method