summaryrefslogtreecommitdiff
path: root/platform/default/online_file_source.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-08-01 18:00:48 +0200
committerKonstantin Käfer <mail@kkaefer.com>2017-08-08 12:40:38 +0200
commitf0a7c45064c3ce3f509b1c2035fcaa07ccc35a99 (patch)
tree5813cfe2fd8e72cbf06f45990351b7412146c398 /platform/default/online_file_source.cpp
parent68f470fdda4e31d7704fba3e41bb2f899db39541 (diff)
downloadqtlocation-mapboxgl-f0a7c45064c3ce3f509b1c2035fcaa07ccc35a99.tar.gz
[core] finish must-revalidate support
Diffstat (limited to 'platform/default/online_file_source.cpp')
-rw-r--r--platform/default/online_file_source.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/default/online_file_source.cpp b/platform/default/online_file_source.cpp
index f10e0f8ffb..08011f5ac1 100644
--- a/platform/default/online_file_source.cpp
+++ b/platform/default/online_file_source.cpp
@@ -320,6 +320,14 @@ void OnlineFileRequest::completed(Response response) {
resource.priorModified = response.modified;
}
+ if (response.notModified && resource.priorData) {
+ // When the priorData field is set, it indicates that we had to revalidate the request and
+ // that the requestor hasn't gotten data yet. If we get a 304 response, this means that we
+ // have send the cached data to give the requestor a chance to actually obtain the data.
+ response.data = std::move(resource.priorData);
+ response.notModified = false;
+ }
+
bool isExpired = false;
if (response.expires) {