fix(resolver): port parser does not handle leading ':'
conditionally trim the leading colon
This commit is contained in:
parent
07d7e15485
commit
f47b562905
1 changed files with 2 additions and 2 deletions
|
|
@ -119,7 +119,7 @@ impl super::Service {
|
||||||
async fn actual_dest_2(&self, dest: &ServerName, cache: bool, pos: usize) -> Result<FedDest> {
|
async fn actual_dest_2(&self, dest: &ServerName, cache: bool, pos: usize) -> Result<FedDest> {
|
||||||
debug!("2: Hostname with included port");
|
debug!("2: Hostname with included port");
|
||||||
let (host, port) = dest.as_str().split_at(pos);
|
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?;
|
.await?;
|
||||||
|
|
||||||
Ok(FedDest::Named(
|
Ok(FedDest::Named(
|
||||||
|
|
@ -165,7 +165,7 @@ impl super::Service {
|
||||||
) -> Result<FedDest> {
|
) -> Result<FedDest> {
|
||||||
debug!("3.2: Hostname with port in .well-known file");
|
debug!("3.2: Hostname with port in .well-known file");
|
||||||
let (host, port) = delegated.split_at(pos);
|
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?;
|
.await?;
|
||||||
|
|
||||||
Ok(FedDest::Named(
|
Ok(FedDest::Named(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue