Call encodeURIComponent on hkp query parameters
This commit is contained in:
parent
b60bea547b
commit
450fddaf8e
|
@ -53,9 +53,9 @@ HKP.prototype.lookup = function(options) {
|
||||||
fetch = this._fetch;
|
fetch = this._fetch;
|
||||||
|
|
||||||
if (options.keyId) {
|
if (options.keyId) {
|
||||||
uri += '0x' + options.keyId;
|
uri += '0x' + encodeURIComponent(options.keyId);
|
||||||
} else if (options.query) {
|
} else if (options.query) {
|
||||||
uri += options.query;
|
uri += encodeURIComponent(options.query);
|
||||||
} else {
|
} else {
|
||||||
throw new Error('You must provide a query parameter!');
|
throw new Error('You must provide a query parameter!');
|
||||||
}
|
}
|
||||||
|
@ -86,4 +86,4 @@ HKP.prototype.upload = function(publicKeyArmored) {
|
||||||
},
|
},
|
||||||
body: 'keytext=' + encodeURIComponent(publicKeyArmored)
|
body: 'keytext=' + encodeURIComponent(publicKeyArmored)
|
||||||
});
|
});
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user