@@ -110,12 +110,18 @@ describe('ipfs subdomain', () => {
110
110
done ( )
111
111
} )
112
112
113
- it ( 'isIPFS.ipnsSubdomain should not match if *.ipns is not a fqdn with tld ' , ( done ) => {
114
- const actual = isIPFS . ipnsSubdomain ( 'http://no-fqdn-with-tld .ipns.dweb.link' )
113
+ it ( 'isIPFS.ipnsSubdomain should not match if *.ipns is not a valid hostname ' , ( done ) => {
114
+ const actual = isIPFS . ipnsSubdomain ( 'http://invalid-hostname- .ipns.dweb.link' )
115
115
expect ( actual ) . to . equal ( false )
116
116
done ( )
117
117
} )
118
118
119
+ it ( 'isIPFS.ipnsSubdomain should match if *.ipns is FQDN inlined into a single DNS label' , ( done ) => {
120
+ const actual = isIPFS . ipnsSubdomain ( 'https://en-wikipedia--on--ipfs-org.ipns.dweb.link' )
121
+ expect ( actual ) . to . equal ( true )
122
+ done ( )
123
+ } )
124
+
119
125
it ( 'isIPFS.subdomain should match an ipfs subdomain' , ( done ) => {
120
126
const actual = isIPFS . subdomain ( 'http://bafybeie5gq4jxvzmsym6hjlwxej4rwdoxt7wadqvmmwbqi7r27fclha2va.ipfs.dweb.link' )
121
127
expect ( actual ) . to . equal ( true )
@@ -148,11 +154,17 @@ describe('ipfs subdomain', () => {
148
154
} )
149
155
150
156
it ( 'isIPFS.subdomain should not match if *.ipns is not libp2pkey nor fqdn' , ( done ) => {
151
- const actual = isIPFS . subdomain ( 'http://not-a-cid-or-dnslink .ipns.dweb.link' )
157
+ const actual = isIPFS . subdomain ( 'http://not-a-cid-or-valid-hostname- .ipns.dweb.link' )
152
158
expect ( actual ) . to . equal ( false )
153
159
done ( )
154
160
} )
155
161
162
+ it ( 'isIPFS.subdomain should match if *.ipns looks like an inlined DNSLink name' , ( done ) => {
163
+ const actual = isIPFS . subdomain ( 'http://en-wikipedia--on--ipfs-org.ipns.dweb.link' )
164
+ expect ( actual ) . to . equal ( true )
165
+ done ( )
166
+ } )
167
+
156
168
it ( 'isIPFS.subdomain should not match a Uint8Array data type' , ( done ) => {
157
169
const actual = isIPFS . subdomain ( uint8ArrayFromString ( 'QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR' , 'base58btc' ) )
158
170
expect ( actual ) . to . equal ( false )
0 commit comments