What is Nostr?
jimbocoin / jimbocoin 🃏
npub1v9q…9q3h
2023-06-28 11:11:55

jimbocoin on Nostr: Question about #Nostr NIP-11: The NIP specifies that relays should respond with the ...

Question about #Nostr NIP-11:

The NIP specifies that relays should respond with the relay document when receiving a request with the 'Accept' header set to 'application/nostr+json'.

Should the response have a 'Content-Type' header of 'application/nostr+json' also? OR should the 'Content-Type' be the simpler 'application/json'.

My guess would be the former. The HTTP client said it would Accept 'application/nostr+json', so it makes sense to send a Content Type of 'application/nostr+json'. However, I'm finding that some tools don't recognize the 'application/nostr+json' content type header.

In my case, I'm using the MockResponse class from the 'node-mocks-http' npm package. The response._isJSON() method returns true for 'application/json' but false for 'application/nostr+json'.

https://github.com/nostr-protocol/nips/blob/master/11.md
Author Public Key
npub1v9qy0ry6uyh36z65pe790qrxfye84ydsgzc877armmwr2l9tpkjsdx9q3h