mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-04-25 09:02:19 +00:00
fix(resolver): port parser does not handle leading ':'
conditionally trim the leading colon
This commit is contained in:
committed by
Jacob Taylor
parent
6ca96742fa
commit
47152f854c
@@ -119,7 +119,7 @@ fn actual_dest_1(host_port: FedDest) -> Result<FedDest> {
|
||||
async fn actual_dest_2(&self, dest: &ServerName, cache: bool, pos: usize) -> Result<FedDest> {
|
||||
debug!("2: Hostname with included port");
|
||||
let (host, port) = dest.as_str().split_at(pos);
|
||||
self.conditional_query_and_cache(host, port.parse::<u16>().unwrap_or(8448), cache)
|
||||
self.conditional_query_and_cache(host, port.trim_start_matches(':').parse::<u16>().unwrap_or(8448), cache)
|
||||
.await?;
|
||||
|
||||
Ok(FedDest::Named(
|
||||
@@ -165,7 +165,7 @@ async fn actual_dest_3_2(
|
||||
) -> Result<FedDest> {
|
||||
debug!("3.2: Hostname with port in .well-known file");
|
||||
let (host, port) = delegated.split_at(pos);
|
||||
self.conditional_query_and_cache(host, port.parse::<u16>().unwrap_or(8448), cache)
|
||||
self.conditional_query_and_cache(host, port.trim_start_matches(':').parse::<u16>().unwrap_or(8448), cache)
|
||||
.await?;
|
||||
|
||||
Ok(FedDest::Named(
|
||||
|
||||
Reference in New Issue
Block a user