Skip to content

fix: add CORS headers to LNURL and NIP-05 endpoints#5

Merged
asheswook merged 1 commit intomainfrom
fix/cors-well-known-endpoints
Apr 21, 2026
Merged

fix: add CORS headers to LNURL and NIP-05 endpoints#5
asheswook merged 1 commit intomainfrom
fix/cors-well-known-endpoints

Conversation

@asheswook
Copy link
Copy Markdown
Owner

@asheswook asheswook commented Apr 21, 2026

  • Adds a withCORS middleware that sets Access-Control-Allow-Origin: *, Access-Control-Allow-Methods: GET, OPTIONS, and Access-Control-Allow-Headers: Content-Type on every response from the public .well-known endpoints.
  • Applies to /.well-known/lnurlp/{user}, /.well-known/nostr.json, and /.well-known/lnurlp/{user}/callback.

Closes #4

Browser-based Lightning wallets (PWAs) were unable to fetch the
/.well-known/lnurlp/* and /.well-known/nostr.json endpoints due to
missing CORS headers. LUD-01/LUD-16 and NIP-05 are explicitly designed
to be consumed by browser clients, so these endpoints must allow
cross-origin access.

Add a withCORS middleware that sets Access-Control-Allow-Origin: * on
every response and short-circuits OPTIONS preflight with 204.

Closes #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CORS headers to LNURL-pay and NIP-05 endpoints

1 participant