mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-20 00:00:11 +02:00
Rename box_body to body (#533)
Probably would have been easier to merge this change directly into `main` first and the backport it to `v0.3.x` but here we are :P Fixes #528
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
//! Example is based on <https://github.com/hyperium/hyper/blob/master/examples/http_proxy.rs>
|
||||
|
||||
use axum::{
|
||||
body::{box_body, Body},
|
||||
body::{boxed, Body},
|
||||
http::{Method, Request, Response, StatusCode},
|
||||
routing::get,
|
||||
Router,
|
||||
@@ -37,7 +37,7 @@ async fn main() {
|
||||
let router = router.clone();
|
||||
async move {
|
||||
if req.method() == Method::CONNECT {
|
||||
proxy(req).await.map(|res| res.map(box_body))
|
||||
proxy(req).await.map(|res| res.map(boxed))
|
||||
} else {
|
||||
router.oneshot(req).await.map_err(|err| match err {})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user