- increment version

- update changelog
- improve query params spec
This commit is contained in:
Sefa Ilkimen
2019-04-03 18:58:19 +02:00
parent 8bdbf7ca78
commit 2cfac2026b
4 changed files with 13 additions and 6 deletions
+4
View File
@@ -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
+1 -1
View File
@@ -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",
+2 -2
View File
@@ -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');
+6 -3
View File
@@ -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&param2=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', () => {