mirror of
https://github.com/aljazceru/cdk.git
synced 2026-01-06 22:45:53 +01:00
strip trailing / from token min url
This commit is contained in:
@@ -122,11 +122,6 @@ pub struct Client {
|
||||
|
||||
impl Client {
|
||||
pub fn new(mint_url: &str) -> Result<Self, Error> {
|
||||
// HACK
|
||||
let mut mint_url = String::from(mint_url);
|
||||
if !mint_url.ends_with('/') {
|
||||
mint_url.push('/');
|
||||
}
|
||||
let mint_url = Url::parse(&mint_url)?;
|
||||
Ok(Self { mint_url })
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ impl TryFrom<&UncheckedUrl> for Url {
|
||||
|
||||
impl fmt::Display for UncheckedUrl {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{}", self.0)
|
||||
write!(f, "{}", self.0.strip_suffix("/").unwrap_or(&self.0))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user