From 583f712fe4dbbbfc9458cf4330e9661603e76de4 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 17 Apr 2025 08:02:12 -0300 Subject: [PATCH] admin: normalize urls for nip86 checking. --- nip86.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nip86.go b/nip86.go index e287054..5bc1c59 100644 --- a/nip86.go +++ b/nip86.go @@ -86,8 +86,9 @@ func (rl *Relay) HandleNIP86(w http.ResponseWriter, r *http.Request) { goto respond } - if uTag := evt.Tags.Find("u"); uTag == nil || rl.getBaseURL(r) != uTag[1] { - resp.Error = "invalid 'u' tag" + if uTag := evt.Tags.Find("u"); uTag == nil || nostr.NormalizeURL(rl.getBaseURL(r)) != nostr.NormalizeURL(uTag[1]) { + resp.Error = fmt.Sprintf("invalid 'u' tag, got '%s', expected '%s'", + nostr.NormalizeURL(rl.getBaseURL(r)), nostr.NormalizeURL(uTag[1])) goto respond } else if pht := evt.Tags.FindWithValue("payload", hex.EncodeToString(payloadHash[:])); pht == nil { resp.Error = "invalid auth event payload hash"