Allow extractor_middleware to extract the body

This commit is contained in:
David Pedersen
2021-07-10 23:39:40 +02:00
parent 2e2f697f80
commit 62da1eac00
2 changed files with 1 additions and 18 deletions
-12
View File
@@ -695,10 +695,6 @@ async fn test_extractor_middleware() {
let app = route(
"/",
get(handler.layer(extract::extractor_middleware::<RequireAuth>())),
)
.route(
"/take-body-error",
post(handler.layer(extract::extractor_middleware::<Bytes>())),
);
let addr = run_in_background(app).await;
@@ -719,14 +715,6 @@ async fn test_extractor_middleware() {
.await
.unwrap();
assert_eq!(res.status(), StatusCode::OK);
let res = client
.post(format!("http://{}/take-body-error", addr))
.body("foobar")
.send()
.await
.unwrap();
assert_eq!(res.status(), StatusCode::INTERNAL_SERVER_ERROR);
}
/// Run a `tower::Service` in the background and get a URI for it.