fix query param url encoding

This commit is contained in:
Sefa Ilkimen
2019-04-03 13:03:49 +02:00
parent 8a83a940cb
commit d5ce3ed76b
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -191,9 +191,9 @@ describe('URL util', function () {
it('serializes query params correctly with URL encoding enabled', () => {
util.serializeQueryParams({
param1: 'value with spaces',
param2: 'value with special character äöü%&'
}, true).should.equal('param1=value%20with%20spaces&param2=value%20with%20special%20character%20%C3%A4%C3%B6%C3%BC%25%26');
'param 1': 'value with spaces',
'param 2': 'value with special character äöü%&'
}, true).should.equal('param%201=value%20with%20spaces&param%202=value%20with%20special%20character%20%C3%A4%C3%B6%C3%BC%25%26');
});
it('serializes array of query params correctly', () => {
+1 -1
View File
@@ -82,7 +82,7 @@ module.exports = function init(helpers) {
function serializeIdentifier(parentKey, key, encode) {
if (!parentKey.length) {
return key;
return encode ? encodeURIComponent(key) : key;
}
if (encode) {