mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-11 16:07:15 +02:00
fix: remove double URL encoding in zap requests
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user