@@ -13,7 +13,7 @@ export const rootRequestHandler = (request: Request, response: Response, next: N
1313
1414 if ( accepts ( request ) . type ( [ 'application/nostr+json' ] ) ) {
1515 const {
16- info : { name, description, pubkey : rawPubkey , contact, relay_url } ,
16+ info : { name, description, banner , icon , pubkey : rawPubkey , self : rawSelf , contact, relay_url, terms_of_service } ,
1717 } = settings
1818
1919 const paymentsUrl = new URL ( relay_url )
@@ -23,16 +23,21 @@ export const rootRequestHandler = (request: Request, response: Response, next: N
2323 const content = settings . limits ?. event ?. content
2424
2525 const pubkey = rawPubkey . startsWith ( 'npub1' ) ? fromBech32 ( rawPubkey ) : rawPubkey
26+ const self = rawSelf ?. startsWith ( 'npub1' ) ? fromBech32 ( rawSelf ) : rawSelf
2627
2728 const relayInformationDocument = {
2829 name,
2930 description,
31+ banner,
32+ icon,
3033 pubkey,
34+ self,
3135 contact,
3236 supported_nips : packageJson . supportedNips ,
3337 supported_nip_extensions : packageJson . supportedNipExtensions ,
3438 software : packageJson . repository . url ,
3539 version : packageJson . version ,
40+ terms_of_service,
3641 limitation : {
3742 max_message_length : settings . network . maxPayloadSize ,
3843 max_subscriptions : settings . limits ?. client ?. subscription ?. maxSubscriptions ,
@@ -68,6 +73,8 @@ export const rootRequestHandler = (request: Request, response: Response, next: N
6873 response
6974 . setHeader ( 'content-type' , 'application/nostr+json' )
7075 . setHeader ( 'access-control-allow-origin' , '*' )
76+ . setHeader ( 'access-control-allow-headers' , '*' )
77+ . setHeader ( 'access-control-allow-methods' , 'GET, OPTIONS' )
7178 . status ( 200 )
7279 . send ( relayInformationDocument )
7380
0 commit comments