From 86cccc4d24804d40ea9d15d47ee1edb975bbf2e3 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 21 Jul 2016 16:37:18 -0700 Subject: [core] Don't allow style mutations to be overwritten by revalidation * Once we get a fresh style, stop revalidating. * If the style is mutated, stop revalidating and preserve the existing mutations. --- include/mbgl/storage/response.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/mbgl/storage') diff --git a/include/mbgl/storage/response.hpp b/include/mbgl/storage/response.hpp index 6c79f5e181..4dc3f36681 100644 --- a/include/mbgl/storage/response.hpp +++ b/include/mbgl/storage/response.hpp @@ -32,6 +32,10 @@ public: optional modified; optional expires; optional etag; + + bool isFresh() const { + return !expires || *expires > util::now(); + } }; class Response::Error { -- cgit v1.2.1