diff --git a/src/hkp/hkp.js b/src/hkp/hkp.js index 89a8e96e..fd764fe0 100644 --- a/src/hkp/hkp.js +++ b/src/hkp/hkp.js @@ -61,7 +61,10 @@ HKP.prototype.lookup = function(options) { } return fetch(uri).then(function(response) { - return response.text(); + if (response.status === 200) { + return response.text(); + } + }).then(function(publicKeyArmored) { if (!publicKeyArmored || publicKeyArmored.indexOf('-----END PGP PUBLIC KEY BLOCK-----') < 0) { return;