From 54f76b5160b0384f9d7654f4261f0084ddf786da Mon Sep 17 00:00:00 2001 From: ekzyis Date: Fri, 27 Dec 2024 01:06:33 +0100 Subject: [PATCH] Fix malformed callback --- lnurl/lnurl.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lnurl/lnurl.go b/lnurl/lnurl.go index fdcb549..bbdfc4a 100644 --- a/lnurl/lnurl.go +++ b/lnurl/lnurl.go @@ -27,11 +27,15 @@ func Router(e *echo.Echo, ln lightning.Lightning) { } func payRequest(c echo.Context) error { - name := c.Param("name") + callback, err := url.JoinPath(env.PublicUrl, "/.well-known/lnurlp/", c.Param("name"), "/pay") + if err != nil { + return err + } + return c.JSON( http.StatusOK, map[string]any{ - "callback": fmt.Sprintf("%s/.well-known/lnurlp/%s/pay", env.PublicUrl, name), + "callback": callback, "minSendable": MIN_SENDABLE_AMOUNT, "maxSendable": MAX_SENDABLE_AMOUNT, "metadata": fmt.Sprintf("[[\"text/plain\",\"paying %s\"]]", name),