diff --git a/web.py b/web.py index 50932ff..2963a0a 100644 --- a/web.py +++ b/web.py @@ -363,7 +363,8 @@ class _Handler(BaseHTTPRequestHandler): try: cached = json.loads(cache_path.read_text('utf-8')) if cached.get('threshold') == threshold and cached.get('min_gap') == min_gap: - self._send(200, json.dumps(cached['result']).encode('utf-8'), 'application/json') + payload = dict(cached['result']); payload['cached'] = True + self._send(200, json.dumps(payload).encode('utf-8'), 'application/json') return except Exception: pass