mirror of https://github.com/rwf2/Rocket.git
Fix AddrParseError when the incoming connection's remote_addr is not known.
This commit is contained in:
parent
2ca15b663a
commit
71b888c2fa
|
@ -746,7 +746,7 @@ impl Rocket {
|
|||
let rocket = Arc::new(self);
|
||||
let service = hyper::make_service_fn(move |connection: &<L as Listener>::Connection| {
|
||||
let rocket = rocket.clone();
|
||||
let remote_addr = connection.remote_addr().unwrap_or_else(|| "0.0.0.0".parse().unwrap());
|
||||
let remote_addr = connection.remote_addr().unwrap_or_else(|| ([0, 0, 0, 0], 0).into());
|
||||
async move {
|
||||
Ok::<_, std::convert::Infallible>(hyper::service_fn(move |req| {
|
||||
hyper_service_fn(rocket.clone(), remote_addr, req)
|
||||
|
|
Loading…
Reference in New Issue