File tree 2 files changed +7
-12
lines changed
2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ function extractName(req) {
15
15
validateDomain ( host ) ;
16
16
17
17
const nonRootSubdomains = host . split ( `.${ config . rootDomain } ` ) . find ( Boolean ) ;
18
-
19
18
const nameFromQueryOrBody = getNameFromReq ( req ) ;
20
19
21
20
let name = nameFromQueryOrBody ;
@@ -67,13 +66,3 @@ function validateDomain(host) {
67
66
) ;
68
67
}
69
68
}
70
-
71
- function validateAndReturnSubdomain ( nonRootSubdomains ) {
72
- if ( ! nonRootSubdomains ) {
73
- throw new AppError (
74
- 422 ,
75
- "The _ format requires a corresponding subdomain as the NIP-05 name."
76
- ) ;
77
- }
78
- return nonRootSubdomains ;
79
- }
Original file line number Diff line number Diff line change @@ -261,6 +261,12 @@ describe("Nostr NIP 05 API tests", () => {
261
261
. send ( userData )
262
262
. expect ( 200 ) ;
263
263
264
+ await request ( app )
265
+ . get ( "/.well-known/webfinger" )
266
+ . set ( "Host" , "nos.social" )
267
+ . query ( { resource :
"acctWRONG:[email protected] " } )
268
+ . expect ( 422 ) ;
269
+
264
270
const getResponse = await request ( app )
265
271
. get ( "/.well-known/webfinger" )
266
272
. set ( "Host" , "nos.social" )
@@ -302,7 +308,7 @@ describe("Nostr NIP 05 API tests", () => {
302
308
} ) ;
303
309
} ) ;
304
310
305
- it . only ( "should store and retrieve Nostr NIP 05 data through an empty subdomain" , async ( ) => {
311
+ it ( "should store and retrieve Nostr NIP 05 data through an empty subdomain" , async ( ) => {
306
312
const userData = createUserPayload ( { name : "_" } ) ;
307
313
308
314
await request ( app )
You can’t perform that action at this time.
0 commit comments