-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optional support for redirect triggered by dnslink
- implements #44 - disabled by default - still work in progress, performance is poor due to the lack of any dns cache
- Loading branch information
Showing
6 changed files
with
67 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict' | ||
|
||
const prefs = require('sdk/simple-prefs').prefs | ||
// const URL = require('sdk/url').URL | ||
const api = require('./api.js') | ||
|
||
function isIpfsEnabled (fqdn) { | ||
if (fqdn === '127.0.0.1' || fqdn === prefs.customGatewayHost) { // TODO: be smarter? | ||
return false | ||
} | ||
// TODO: add cache | ||
let ipfsSupport = api.isDnslinkPresent(fqdn) | ||
// console.log('dns.isIpfsEnabled(' + fqdn + ')=' + ipfsSupport) | ||
return ipfsSupport | ||
} | ||
|
||
exports.isIpfsEnabled = isIpfsEnabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters