Skip to content

Commit a8d8607

Browse files
authored
fix: support ../tcp/1234/tls/http multiaddrs (#52)
Recognise these types of multiaddrs as HTTPS
1 parent aed4a60 commit a8d8607

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ export const HTTP = fmt(_HTTP)
458458
const _HTTPS = or(
459459
and(_IP_OR_DOMAIN, literal('tcp'), or(
460460
and(literal('443'), literal('http')),
461-
and(number(), literal('https'))
461+
and(number(), literal('https')),
462+
and(number(), literal('tls'), literal('http'))
462463
), optional(peerId())),
463464
and(_IP_OR_DOMAIN, literal('tls'), literal('http'), optional(peerId())),
464465
and(_IP_OR_DOMAIN, literal('https'), optional(peerId()))

test/index.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ describe('multiaddr matcher', () => {
328328
'/dns6/example.org/tcp/443/http',
329329
'/dnsaddr/example.org/tcp/443/http',
330330
'/dns/example.org/tcp/443/http',
331+
'/dns/example.org/tcp/7777/tls/http',
332+
'/dns/example.org/tcp/443/tls/http',
331333
'/dns4/example.org/tls/http',
332334
'/dns/example.org/tls/http/p2p/12D3KooWQF6Q3i1QkziJQ9mkNNcyFD8GPQz6R6oEvT75wgsVXm4v'
333335
]

0 commit comments

Comments
 (0)