Skip to content

Commit

Permalink
FIX for false-positive href rewrites
Browse files Browse the repository at this point in the history
- Closes #43
  • Loading branch information
lidel committed Jan 16, 2016
1 parent 701443c commit f696599
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/gateways.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const {Cc, Ci} = require('chrome')
const prefs = require('sdk/simple-prefs').prefs
const ioservice = Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService)

// TODO: replace regex with 3rd party library provided by IPFS community
// Ref. https://github.com/ipfs/notes/issues/92#issuecomment-172135885
const IPFS_RESOURCE = /^https?:\/\/[^\/]+\/ip(f|n)s\//

exports.IPFS_RESOURCE = IPFS_RESOURCE
Expand Down
4 changes: 3 additions & 1 deletion lib/protocols.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const IPNS_SCHEME = 'ipns'
const FS_SCHEME = 'fs'
const WEB_SCHEME_PREFIX = 'web+' // https://github.com/lidel/ipfs-firefox-addon/issues/36

const IPFS_PATH = new RegExp('^/ip(f|n)s/')
// TODO: replace regex with 3rd party library provided by IPFS community
// Ref. https://github.com/ipfs/notes/issues/92#issuecomment-172135885
const IPFS_PATH = new RegExp('^/(ipns/|ipfs/Qm[1-9A-HJ-NP-Za-km-z]{44})')

function CommonProtocolHandler () {}

Expand Down

0 comments on commit f696599

Please sign in to comment.