From 66ec3f2f20e8aff080def30b485844d516cbc467 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Thu, 10 Dec 2015 14:42:04 +0200 Subject: [PATCH] url with % fixed It seems that this url is a special case since url encoding techniques failed for both ios and android. For ios: stringByAddingPercentEscapesUsingEncoding stringByAddingPercentEncodingWithAllowedCharacters For android: java.net.URLEncoder --- apps/tests/http-tests.ts | 3 ++- http/http-request.android.ts | 3 ++- http/http-request.ios.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/tests/http-tests.ts b/apps/tests/http-tests.ts index b50f0949b..3eece7c05 100644 --- a/apps/tests/http-tests.ts +++ b/apps/tests/http-tests.ts @@ -534,7 +534,8 @@ export var test_getString_FromVariousUrls_ShouldWorkProperly = function (done) { var urls = [ "https://it-ebooks-api.info/v1/book/1615005640", "https://www.telerik.com", - "https://spreadsheets.google.com/tq?key=1tJ64Y8hje0ui4ap9U33h3KWwpxT_-JuVMSZzxD2Er8k" + "https://spreadsheets.google.com/tq?key=1tJ64Y8hje0ui4ap9U33h3KWwpxT_-JuVMSZzxD2Er8k", + "https://chase.arborgoldcloud.net/mobilehandler/mobiledatahandler.ashx?ProcedureName=MEstimGetJobListSpeed&@prmSalesRep=%&@prmStartDate=11/1/2015&@prmEndDate=12/8/2015&@prmStatusFilter=2" ]; var i: number; diff --git a/http/http-request.android.ts b/http/http-request.android.ts index 8a8ac9baa..e32469af3 100644 --- a/http/http-request.android.ts +++ b/http/http-request.android.ts @@ -75,7 +75,8 @@ function buildJavaOptions(options: http.HttpRequestOptions) { var javaOptions = new com.tns.Async.Http.RequestOptions(); - javaOptions.url = options.url; + javaOptions.url = options.url.replace("%", "%25"); + if (types.isString(options.method)) { javaOptions.method = options.method; } diff --git a/http/http-request.ios.ts b/http/http-request.ios.ts index e37d79bc6..ca1827d7b 100644 --- a/http/http-request.ios.ts +++ b/http/http-request.ios.ts @@ -20,7 +20,7 @@ export function request(options: http.HttpRequestOptions): Promise