From 85efb463cffccb67119805b68d08fda614613a7c Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Sun, 27 Dec 2015 16:27:55 +0700 Subject: [PATCH] Check http status when uploading key --- src/hkp/hkp.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;