From d952880182684e774faec4d2319177e0f2a8a307 Mon Sep 17 00:00:00 2001 From: santosoh <66933805+santosoh@users.noreply.github.com> Date: Mon, 3 Aug 2020 01:40:56 +0800 Subject: [PATCH 1/2] Update to use same builder object for all request When building request object for network request, if the header contain "content_type", the current codes create new "requestBuilder" object instead of using existing "builder" object, and resulting the request to loose all the other headers/session headers that might exist. The update is to reuse existing "builder" object instead. --- .../java/com/jasonette/seed/Action/JasonNetworkAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/jasonette/seed/Action/JasonNetworkAction.java b/app/src/main/java/com/jasonette/seed/Action/JasonNetworkAction.java index c0c76a0a..d1e31002 100644 --- a/app/src/main/java/com/jasonette/seed/Action/JasonNetworkAction.java +++ b/app/src/main/java/com/jasonette/seed/Action/JasonNetworkAction.java @@ -129,9 +129,9 @@ private void _request(final JSONObject callback, final JSONObject action, final mediaType = MediaType.parse(content_type); d = Base64.decode(options.getString("data"), Base64.DEFAULT); } - Request.Builder requestBuilder = new Request.Builder(); + // Request.Builder requestBuilder = new Request.Builder(); - request = requestBuilder + request = builder .url(url) .method(method, RequestBody.create(mediaType, d)) .build(); From a9c089be8793c916299657eaa313ede2a9419676 Mon Sep 17 00:00:00 2001 From: santosoh <66933805+santosoh@users.noreply.github.com> Date: Tue, 4 Aug 2020 00:39:19 +0800 Subject: [PATCH 2/2] Update JasonNetworkAction.java --- .../main/java/com/jasonette/seed/Action/JasonNetworkAction.java | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/com/jasonette/seed/Action/JasonNetworkAction.java b/app/src/main/java/com/jasonette/seed/Action/JasonNetworkAction.java index d1e31002..66a14b6a 100644 --- a/app/src/main/java/com/jasonette/seed/Action/JasonNetworkAction.java +++ b/app/src/main/java/com/jasonette/seed/Action/JasonNetworkAction.java @@ -129,7 +129,6 @@ private void _request(final JSONObject callback, final JSONObject action, final mediaType = MediaType.parse(content_type); d = Base64.decode(options.getString("data"), Base64.DEFAULT); } - // Request.Builder requestBuilder = new Request.Builder(); request = builder .url(url)