nipb0: blossom URL normalization.

This commit is contained in:
fiatjaf
2025-11-18 23:04:41 -03:00
parent 8ea2a00037
commit 6cdcdfbae9

View File

@@ -17,9 +17,7 @@ type Client struct {
// NewClient creates a new Blossom client
func NewClient(mediaserver string, signer nostr.Signer) *Client {
if !strings.HasPrefix(mediaserver, "http") {
mediaserver = "https://" + mediaserver
}
mediaserver = "http" + nostr.NormalizeURL(mediaserver)[2:]
return &Client{
mediaserver: strings.TrimSuffix(mediaserver, "/") + "/",