From 0cb246b0c5e9363025981c406ea292f6c10c0336 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Wed, 28 Oct 2026 16:53:07 +0800 Subject: [PATCH] fix: parse gateway addresses before IPv4 resolution --- crates/gpapi/src/params/gateway_login.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/gpapi/src/params/gateway_login.rs b/crates/gpapi/src/params/gateway_login.rs index 19640d7..68d3456 100644 --- a/crates/gpapi/src/params/gateway_login.rs +++ b/crates/gpapi/src/params/gateway_login.rs @@ -134,7 +134,9 @@ fn resolve_server(input: &GatewayLoginInput) -> String { /// Attempt DNS resolution of a hostname to its first IPv4 address. fn resolve_to_ipv4(host: &str) -> Option { - (host, 443) + let server = crate::utils::normalize_server(host).ok()?; + let server = reqwest::Url::parse(&server).ok()?; + (server.host_str()?, server.port_or_known_default()?) .to_socket_addrs() .ok()? .find(|addr| addr.ip().is_ipv4())