Skip to content

fix: filter NIP-05 nostr.json by the ?name query param#3

Closed
sepehr-safari wants to merge 1 commit into
mainfrom
fix/nip05-name-filter
Closed

fix: filter NIP-05 nostr.json by the ?name query param#3
sepehr-safari wants to merge 1 commit into
mainfrom
fix/nip05-name-filter

Conversation

@sepehr-safari

@sepehr-safari sepehr-safari commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Problem

/.well-known/nostr.json was a static file (public/.well-known/nostr.json). Static files are served verbatim and can't read a query string, so every handle was returned on every request regardless of the queried name.

Fix

Replace the static file with a dynamic App Router route handler that honors the NIP-05 ?name=<local-part> query and returns only the matching mapping — or {"names":{}} when the name is absent/unknown.

Superseded by a clean branch; closing this one.

Serve /.well-known/nostr.json from a dynamic route handler instead of a
static public/ file. A static file can't read the query string, so every
handle was returned on every request. The handler honors the NIP-05
`?name=<local-part>` query and returns only the requested mapping, or
`{"names":{}}` when the name is absent or unknown.

CORS moves into the handler so the endpoint owns its whole response;
keeping the header in next.config too would emit it twice.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zignostr.com Ready Ready Preview, Comment Jul 16, 2026 5:05pm

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.

1 participant