From e12f2b3f90ed390f7c5649e129396e8c8d389dc7 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 8 Jun 2025 10:53:15 -0300 Subject: [PATCH] nip27: fix ws:// parsing. --- nip27/blocks.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nip27/blocks.go b/nip27/blocks.go index eb718fa..3fd463d 100644 --- a/nip27/blocks.go +++ b/nip27/blocks.go @@ -85,7 +85,7 @@ func Parse(content string) iter.Seq[Block] { end = u + 4 + m[0] } prefixLen := 4 - if content[u-1] == 's' { + if content[u-1] == 's' { // // "http(s?):"-1 will be either "s" or "p" prefixLen = 5 } parsed, err := url.Parse(content[u-prefixLen : end]) @@ -115,7 +115,7 @@ func Parse(content string) iter.Seq[Block] { end = u + 4 + m[0] } prefixLen := 2 - if content[u-1] == 's' { + if content[u-2] == 's' { // "ws(s?):"-1 == "s" always, but "ws(s?):" - 2 may be either "w" or "s" prefixLen = 3 } parsed, err := url.Parse(content[u-prefixLen : end])