nipb0: fixes to blossom.

This commit is contained in:
fiatjaf
2025-03-04 19:20:11 -03:00
parent 2865cccc46
commit b3b8d5804d
6 changed files with 13 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
package blossom
import (
"strings"
"time"
"github.com/nbd-wtf/go-nostr"
@@ -16,8 +17,12 @@ 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
}
return &Client{
mediaserver: mediaserver,
mediaserver: strings.TrimSuffix(mediaserver, "/") + "/",
httpClient: createHTTPClient(),
signer: signer,
}