This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,10 @@ const errcode = require('err-code')
7
7
module . exports = ( domain , opts , callback ) => {
8
8
resolveDnslink ( domain )
9
9
. catch ( err => {
10
- // If the code is not ENOTFOUND or ERR_DNSLINK_NOT_FOUND then throw the error
11
- if ( err . code !== 'ENOTFOUND' && err . code !== 'ERR_DNSLINK_NOT_FOUND' ) throw err
10
+ // If the code is not ENOTFOUND or ERR_DNSLINK_NOT_FOUND or ENODATA then throw the error
11
+ if ( err . code !== 'ENOTFOUND' && err . code !== 'ERR_DNSLINK_NOT_FOUND' && err . code !== 'ENODATA' ) {
12
+ throw err
13
+ }
12
14
13
15
if ( domain . startsWith ( '_dnslink.' ) ) {
14
16
// The supplied domain contains a _dnslink component
Original file line number Diff line number Diff line change @@ -27,4 +27,20 @@ describe('dns', () => runOnAndOff((thing) => {
27
27
expect ( res . substr ( 0 , 6 ) ) . to . eql ( '/ipns/' )
28
28
} )
29
29
} )
30
+
31
+ it ( 'resolve subdomain docs.ipfs.io dns' , function ( ) {
32
+ this . timeout ( 60 * 1000 )
33
+
34
+ return ipfs ( 'dns docs.ipfs.io' ) . then ( res => {
35
+ expect ( res . substr ( 0 , 6 ) ) . to . eql ( '/ipfs/' )
36
+ } )
37
+ } )
38
+
39
+ it ( 'resolve subdomain _dnslink.docs.ipfs.io dns' , function ( ) {
40
+ this . timeout ( 60 * 1000 )
41
+
42
+ return ipfs ( 'dns _dnslink.docs.ipfs.io' ) . then ( res => {
43
+ expect ( res . substr ( 0 , 6 ) ) . to . eql ( '/ipfs/' )
44
+ } )
45
+ } )
30
46
} ) )
You can’t perform that action at this time.
0 commit comments