Parameterize ContentLengthLimit

This commit is contained in:
David Pedersen
2021-06-09 08:14:20 +02:00
parent 09f76f3c87
commit 90c3e5ba74
6 changed files with 21 additions and 18 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
use crate::{handler::on, prelude::*, routing::MethodFilter, service};
use bytes::Bytes;
use http::{Request, Response, StatusCode};
use hyper::{Body, Server};
use serde::Deserialize;
@@ -137,7 +138,7 @@ async fn body_with_length_limit() {
let app = route(
"/",
post(
|req: Request<Body>, _body: extract::BytesMaxLength<LIMIT>| async move {
|req: Request<Body>, _body: extract::ContentLengthLimit<Bytes, LIMIT>| async move {
dbg!(&req);
},
),