fix:correct RemoteAddr extension type to enable IP-based policy evaluation (#1356)

This commit is contained in:
LeonWang0735
2026-01-04 10:13:27 +08:00
committed by GitHub
parent 4d0045ff18
commit de4a3fa766
14 changed files with 60 additions and 60 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ pub(crate) struct ReqInfo {
/// Authorizes the request based on the action and credentials.
pub async fn authorize_request<T>(req: &mut S3Request<T>, action: Action) -> S3Result<()> {
let remote_addr = req.extensions.get::<RemoteAddr>().map(|a| a.0);
let remote_addr = req.extensions.get::<Option<RemoteAddr>>().and_then(|opt| opt.map(|a| a.0));
let req_info = req.extensions.get_mut::<ReqInfo>().expect("ReqInfo not found");