2 parents 712e199 + b46dd10 commit 1cf789aCopy full SHA for 1cf789a
1 file changed
nsite/helpers.go
@@ -2,6 +2,7 @@ package nsite
2
3
import (
4
"fmt"
5
+ "net"
6
"strings"
7
8
"fiatjaf.com/nostr"
@@ -10,6 +11,13 @@ import (
10
11
)
12
13
func resolveSite(host string) (nostr.Event, error) {
14
+ // normalize the incoming host the same way the caller does before MatchesHost
15
+ host = strings.TrimSpace(host)
16
+ if h, _, err := net.SplitHostPort(host); err == nil {
17
+ host = h
18
+ }
19
+ host = strings.ToLower(host)
20
+
21
domain := strings.Trim(strings.ToLower(global.Settings.Nsite.Domain), ".")
22
if host == domain {
23
return nostr.Event{}, fmt.Errorf("domain mismatch")
0 commit comments