feat(lookup): Allow forcing lookup over http, for testing purposes. (#47) r=@vladikoff
* feat(lookup): Allow forcing lookup over http, for testing purposes. For mozilla/browserid-verifier#106
This commit is contained in:
Родитель
d88eff1c8b
Коммит
7d2faffd1a
|
@ -12,7 +12,8 @@ function Verifier(args) {
|
|||
this.args = _.extend({
|
||||
'maxDelegations': 5,
|
||||
'httpTimeout': 10.0,
|
||||
'insecureSSL': false
|
||||
'insecureSSL': false,
|
||||
'forceInsecureLookupOverHTTP': false
|
||||
}, args);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@ const DEFAULT_PORTS = {
|
|||
// like https.get() but transparently supports the
|
||||
// $https_proxy and $no_proxy environment variables.
|
||||
var getWithTransparentProxying = function(options, cb) {
|
||||
var httpmod = https;
|
||||
options = options || {};
|
||||
var httpmod = options.httpmod || https;
|
||||
var proxy = shouldUseProxy(options.host);
|
||||
if (proxy) {
|
||||
if (proxy.scheme === 'http') {
|
||||
|
@ -130,6 +131,7 @@ var fetchWellKnown = function (emitter, args, currentDomain, principalDomain, cl
|
|||
port: port,
|
||||
path: pathToWellKnown,
|
||||
rejectUnauthorized: !args.insecureSSL,
|
||||
httpmod: (!! args.forceInsecureLookupOverHTTP) ? http : https,
|
||||
agent: false
|
||||
}, function(res) {
|
||||
var body = "";
|
||||
|
|
Загрузка…
Ссылка в новой задаче