summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-01-14 18:17:53 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-01-14 18:38:56 -0800
commitf62d41ae05adade69fb08cff3c071b960c25c857 (patch)
tree805afedbea3aec92d46c5278ab99fe925655d6c4 /platform
parente44db93f1cb3276dcdc7de8400ca96beda1b1d30 (diff)
downloadqtlocation-mapboxgl-f62d41ae05adade69fb08cff3c071b960c25c857.tar.gz
[core] Restore existing response body
Until #2721 lands we still need this.
Diffstat (limited to 'platform')
-rw-r--r--platform/android/src/http_request_android.cpp2
-rw-r--r--platform/darwin/http_request_nsurl.mm2
-rw-r--r--platform/default/http_request_curl.cpp2
3 files changed, 6 insertions, 0 deletions
diff --git a/platform/android/src/http_request_android.cpp b/platform/android/src/http_request_android.cpp
index 3458040083..9a554f5281 100644
--- a/platform/android/src/http_request_android.cpp
+++ b/platform/android/src/http_request_android.cpp
@@ -209,6 +209,8 @@ void HTTPAndroidRequest::onResponse(int code, std::string message, std::string e
response->notModified = true;
if (existingResponse) {
+ response->data = existingResponse->data;
+
if (response->expires == Seconds::zero()) {
response->expires = existingResponse->expires;
}
diff --git a/platform/darwin/http_request_nsurl.mm b/platform/darwin/http_request_nsurl.mm
index a43210cbc0..306cf96293 100644
--- a/platform/darwin/http_request_nsurl.mm
+++ b/platform/darwin/http_request_nsurl.mm
@@ -229,6 +229,8 @@ void HTTPNSURLRequest::handleResult(NSData *data, NSURLResponse *res, NSError *e
response->notModified = true;
if (existingResponse) {
+ response->data = existingResponse->data;
+
if (response->expires == Seconds::zero()) {
response->expires = existingResponse->expires;
}
diff --git a/platform/default/http_request_curl.cpp b/platform/default/http_request_curl.cpp
index 7f95d187cb..5ef8cddb74 100644
--- a/platform/default/http_request_curl.cpp
+++ b/platform/default/http_request_curl.cpp
@@ -532,6 +532,8 @@ void HTTPCURLRequest::handleResult(CURLcode code) {
response->notModified = true;
if (existingResponse) {
+ response->data = existingResponse->data;
+
if (response->expires == Seconds::zero()) {
response->expires = existingResponse->expires;
}