diff --git a/CHANGELOG.md b/CHANGELOG.md index 26d7875..186abbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.0.7 + +- Fixed #195: URLs are double-encoded on Android + ## 2.0.6 - Fixed #187: setSSLCertMode with "default" throws an error on Android diff --git a/package.json b/package.json index 3a2dfc2..b1f6269 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-advanced-http", - "version": "2.0.6", + "version": "2.0.7", "description": "Cordova / Phonegap plugin for communicating with HTTP servers using SSL pinning", "scripts": { "updatecert": "node ./scripts/update-test-cert.js", diff --git a/test/app-test-definitions.js b/test/app-test-definitions.js index 10f2e01..d6014cf 100644 --- a/test/app-test-definitions.js +++ b/test/app-test-definitions.js @@ -551,7 +551,7 @@ const tests = [ }, { description: 'should not double encode spaces in url path #195', - expected: '', + expected: 'resolved: {"status": 200, "data": "{\\"url\\":\\"https://httpbin.org/anything/containing spaces in url\\" ...', func: function(resolve, reject) { cordova.plugin.http.get('https://httpbin.org/anything/containing%20spaces%20in%20url', {}, {}, resolve, reject); }, validationFunc: function(driver, result) { result.type.should.be.equal('resolved'); @@ -560,7 +560,7 @@ const tests = [ }, { description: 'should encode spaces in url query correctly', - expected: '', + expected: 'resolved: {"status": 200, "data": "{\\"url\\":\\"https://httpbin.org/anything?query key=very long query value with spaces\\" ...', func: function(resolve, reject) { cordova.plugin.http.get('https://httpbin.org/anything', { 'query key': 'very long query value with spaces' }, {}, resolve, reject); }, validationFunc: function(driver, result) { result.type.should.be.equal('resolved'); diff --git a/test/js-mocha-specs.js b/test/js-mocha-specs.js index 8ef7ce7..d631793 100644 --- a/test/js-mocha-specs.js +++ b/test/js-mocha-specs.js @@ -184,9 +184,12 @@ describe('URL util', function () { it('serializes query params correctly', () => { util.serializeQueryParams({ - param1: 'value with spaces', - param2: 'value with special character äöü%' - }, false).should.equal('param1=value with spaces¶m2=value with special character äöü%'); + strParam1: 'value with spaces', + strParam2: 'value with special character äöü%', + boolParam: true, + numberParam: 1, + nullParam: null, + }, false).should.equal('strParam1=value with spaces&strParam2=value with special character äöü%&boolParam=true&numberParam=1&nullParam=null'); }); it('serializes query params correctly with URL encoding enabled', () => {