From 2ae350af5a96ff2c11a43c2bcb5020bf771191bd Mon Sep 17 00:00:00 2001 From: David Dias Date: Sat, 21 May 2016 23:34:53 +0100 Subject: [PATCH] include ipfs for webrtcstar validation --- src/index.js | 3 +-- test/index.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 0faa85c..68ce84a 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,7 @@ var TCP = and(IP, base('tcp')) var UDP = and(IP, base('udp')) var UTP = and(UDP, base('utp')) var WebSockets = and(TCP, base('ws')) -var WebRTCStar = and(base('libp2p-webrtc-star'), WebSockets) +var WebRTCStar = and(base('libp2p-webrtc-star'), WebSockets, base('ipfs')) var Reliable = or(TCP, UTP) var IPFS = and(Reliable, base('ipfs')) @@ -38,7 +38,6 @@ function and () { if (a.length < args.length) { return null } - args.some(function (arg) { a = arg.partialMatch(a) if (a === null) { diff --git a/test/index.spec.js b/test/index.spec.js index c1a5ad8..92be779 100644 --- a/test/index.spec.js +++ b/test/index.spec.js @@ -52,8 +52,8 @@ describe('multiaddr validation', function () { ] var goodWebRTCStar = [ - '/libp2p-webrtc-star/ip4/1.2.3.4/tcp/3456/ws', - '/libp2p-webrtc-star/ip6/::/tcp/0/ws' + '/libp2p-webrtc-star/ip4/1.2.3.4/tcp/3456/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4', + '/libp2p-webrtc-star/ip6/::/tcp/0/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo5' ] var badWS = [