Skip to content
Snippets Groups Projects
Commit 14ac65bb authored by Austin King's avatar Austin King
Browse files

Fixing secondary behavior. Merging r=lloyd

parent 21398f8d
No related branches found
No related tags found
No related merge requests found
......@@ -97,13 +97,12 @@ var getWellKnown = function (domain, cb) {
function handleResponse(res) {
var msg;
if (res.statusCode !== 200) {
logger.debug(' is not a browserid primary - non-200 response code to ' + WELL_KNOWN_URL);
return cb("can't get public key for " + domain);
logger.debug(domain + ' is not a browserid primary - non-200 response code to ' + WELL_KNOWN_URL);
return cb(null, false, null);
}
if (res.headers['content-type'].indexOf('application/json') !== 0) {
msg = domain + ' is not a browserid primary - non "application/json" response to ' + WELL_KNOWN_URL
logger.debug(msg);
return cb(msg);
logger.debug(domain + ' is not a browserid primary - non "application/json" response to ' + WELL_KNOWN_URL);
return cb(null, false, null);
}
var body = "";
......@@ -152,14 +151,16 @@ var getWellKnown = function (domain, cb) {
}
req.on('error', function(e) {
var msg = domain + ' is not a browserid primary: ' + e.toString();
logger.debug(msg);
cb(msg);
logger.debug(domain + ' is not a browserid primary: ' + e.toString());
cb(null, false, null);
});
};
exports.getPublicKey = function(domain, cb) {
exports.checkSupport(domain, function(err, urls, publicKey) {
if (publicKey === null) {
return cb("can't get public key for " + domain);
}
cb(err, publicKey);
});
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment