diff options
| author | Adam Soltys <[email protected]> | 2025-01-18 22:45:50 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-01-18 22:45:50 -0800 |
| commit | a328ce2a57e9d2982e491c6ec6d48ec70cd8b335 (patch) | |
| tree | 5bfa63a2e89437db4166126e033c684bbfa87887 /routes | |
| parent | 1a798efccf93c1a68fe76db13d85512f54f7078b (diff) | |
| download | coinos-server-a328ce2a57e9d2982e491c6ec6d48ec70cd8b335.tar.gz coinos-server-a328ce2a57e9d2982e491c6ec6d48ec70cd8b335.zip | |
fix zap request encoding
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/nostr.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/routes/nostr.ts b/routes/nostr.ts index 7beeb687..854f735f 100644 --- a/routes/nostr.ts +++ b/routes/nostr.ts @@ -271,11 +271,10 @@ export default { const pubkey = event.tags.find((t) => t[0] === "p")[1]; const content = JSON.stringify(await getProfile(pubkey)); const callback = await getZapEndpoint({ content } as Event); - const url = new URL(callback); - url.searchParams.set("amount", (amount * 1000).toString()); - url.searchParams.set("nostr", encodeURI(JSON.stringify(event))); - console.log("URL", url.toString()); - const json = await got(url.toString()).json(); + + const encodedEvent = encodeURI(JSON.stringify(event)); + const url = `${callback}?amount=${amount * 1000}&nostr=${encodedEvent}`; + const json = await got(url).json(); res.send(json); } catch (e) { |
