nipb0: blossom URL normalization.
This commit is contained in:
@@ -17,9 +17,7 @@ type Client struct {
|
|||||||
|
|
||||||
// NewClient creates a new Blossom client
|
// NewClient creates a new Blossom client
|
||||||
func NewClient(mediaserver string, signer nostr.Signer) *Client {
|
func NewClient(mediaserver string, signer nostr.Signer) *Client {
|
||||||
if !strings.HasPrefix(mediaserver, "http") {
|
mediaserver = "http" + nostr.NormalizeURL(mediaserver)[2:]
|
||||||
mediaserver = "https://" + mediaserver
|
|
||||||
}
|
|
||||||
|
|
||||||
return &Client{
|
return &Client{
|
||||||
mediaserver: strings.TrimSuffix(mediaserver, "/") + "/",
|
mediaserver: strings.TrimSuffix(mediaserver, "/") + "/",
|
||||||
|
|||||||
Reference in New Issue
Block a user