Provide correct zero ClientInfo with unix sockets, fixes #310

This commit is contained in:
dasha_uwu
2026-02-15 07:31:45 +05:00
committed by Jason Volk
parent e48101a6a6
commit 488bd62016

View File

@@ -2,7 +2,7 @@
use std::{ use std::{
fs, fs,
net::SocketAddr, net::{IpAddr, Ipv4Addr, SocketAddr},
os::unix::{fs::PermissionsExt, net::UnixListener}, os::unix::{fs::PermissionsExt, net::UnixListener},
path::Path, path::Path,
sync::Arc, sync::Arc,
@@ -36,7 +36,7 @@ pub(super) async fn serve(
let router = router let router = router
.clone() .clone()
.layer(Extension(ConnectInfo("0.0.0.0".parse::<SocketAddr>()))) .layer(Extension(ConnectInfo(SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), 0))))
.into_make_service(); .into_make_service();
let acceptor = axum_server::from_unix(unix_listener)? let acceptor = axum_server::from_unix(unix_listener)?
.handle(handle.clone()) .handle(handle.clone())