Check http status when uploading key

This commit is contained in:
Tankred Hase 2015-12-27 16:27:55 +07:00
parent 2fe10749a1
commit 85efb463cf

View File

@ -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;