fix: remove double URL encoding in zap requests (#145)

The zap request JSON was being encoded twice:
1. Manually via encodeURIComponent in serializeZapRequest()
2. Automatically by URLSearchParams.set() when building callback URL

This caused overly-encoded URLs (e.g., '{' → '%7B' → '%257B').

Fix: Remove manual encoding and let URLSearchParams handle it.
Verified: Tests pass, build succeeds

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Alejandro
2026-01-19 09:08:53 +01:00
committed by GitHub
parent dbcbcf6181
commit f56228f88a

View File

@@ -118,8 +118,9 @@ export async function createZapRequest(
}
/**
* Serialize zap request event to URL-encoded JSON for LNURL callback
* Serialize zap request event to JSON string for LNURL callback
* Note: Do NOT encodeURIComponent here - URLSearchParams.set() will handle encoding
*/
export function serializeZapRequest(event: NostrEvent): string {
return encodeURIComponent(JSON.stringify(event));
return JSON.stringify(event);
}