diff --git a/src/hkp/hkp.js b/src/hkp/hkp.js index 92e03732..89a8e96e 100644 --- a/src/hkp/hkp.js +++ b/src/hkp/hkp.js @@ -53,9 +53,9 @@ HKP.prototype.lookup = function(options) { fetch = this._fetch; if (options.keyId) { - uri += '0x' + options.keyId; + uri += '0x' + encodeURIComponent(options.keyId); } else if (options.query) { - uri += options.query; + uri += encodeURIComponent(options.query); } else { throw new Error('You must provide a query parameter!'); } @@ -86,4 +86,4 @@ HKP.prototype.upload = function(publicKeyArmored) { }, body: 'keytext=' + encodeURIComponent(publicKeyArmored) }); -}; +}; \ No newline at end of file