Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
feat: filter IPFS addrs correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov committed Aug 3, 2017
1 parent 0d1f849 commit a49b546
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const connect = require('pull-ws/client')
const mafmt = require('mafmt')
const includes = require('lodash.includes')
const Connection = require('interface-connection').Connection

const maToUrl = require('./ma-to-url')
Expand Down Expand Up @@ -49,10 +48,10 @@ class WebSockets {
}

return multiaddrs.filter((ma) => {
if (includes(ma.protoNames(), 'ipfs')) {
ma = ma.decapsulate('ipfs')
}
return mafmt.WebSockets.matches(ma) || mafmt.WebSocketsSecure.matches(ma)
return mafmt.WebSockets.matches(ma) ||
mafmt.WebSocketsSecure.matches(ma) ||
mafmt.WebSocketsIPFS.matches(ma) ||
mafmt.WebSocketsSecureIPFS.matches(ma)
})
}
}
Expand Down

0 comments on commit a49b546

Please sign in to comment.