Skip to content

Commit

Permalink
sanitize mint url
Browse files Browse the repository at this point in the history
  • Loading branch information
Kukks committed Oct 8, 2024
1 parent 64fa920 commit 5b79f4b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DotNut/Encoding/CashuTokenHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public static string Encode(this CashuToken token, string version = "B", bool ma
throw new NotSupportedException($"Version {version} is not supported");
}

//trim trailing slash from mint url
foreach (var token2 in token.Tokens.Where(token1 => token1.Mint.EndsWith("/")))
{
token2.Mint = token2.Mint.TrimEnd('/');
}
var result = encoder.Encode(token);

if (makeUri)
Expand Down

0 comments on commit 5b79f4b

Please sign in to comment.