mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-24 00:00:16 +02:00
Remove B type param: Follow ups (#1789)
Co-authored-by: Jonas Platte <[email protected]> Co-authored-by: Michael Scofield <[email protected]>
This commit is contained in:
co-authored by
Jonas Platte
Michael Scofield
parent
72c1b7a80c
commit
6703f8634c
@@ -13,8 +13,9 @@
|
||||
//! Example is based on <https://github.com/hyperium/hyper/blob/master/examples/http_proxy.rs>
|
||||
|
||||
use axum::{
|
||||
body::{self, Body},
|
||||
http::{Method, Request, StatusCode},
|
||||
body::Body,
|
||||
extract::Request,
|
||||
http::{Method, StatusCode},
|
||||
response::{IntoResponse, Response},
|
||||
routing::get,
|
||||
Router,
|
||||
@@ -59,7 +60,7 @@ async fn main() {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
async fn proxy(req: Request<Body>) -> Result<Response, hyper::Error> {
|
||||
async fn proxy(req: Request) -> Result<Response, hyper::Error> {
|
||||
tracing::trace!(?req);
|
||||
|
||||
if let Some(host_addr) = req.uri().authority().map(|auth| auth.to_string()) {
|
||||
@@ -74,7 +75,7 @@ async fn proxy(req: Request<Body>) -> Result<Response, hyper::Error> {
|
||||
}
|
||||
});
|
||||
|
||||
Ok(Response::new(body::boxed(body::Empty::new())))
|
||||
Ok(Response::new(Body::empty()))
|
||||
} else {
|
||||
tracing::warn!("CONNECT host is not socket addr: {:?}", req.uri());
|
||||
Ok((
|
||||
|
||||
Reference in New Issue
Block a user