From 16f8f023e59f676c56af150a8104d7dbd9d9e7b4 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 19 Oct 2021 21:21:36 +0100 Subject: [PATCH] Aliases for post and get --- daemon.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index 7d5085314..b89f52331 100644 --- a/daemon.py +++ b/daemon.py @@ -12681,6 +12681,10 @@ class PubServer(BaseHTTPRequestHandler): if authorized and '/performance?graph=' in self.path: graph = self.path.split('?graph=')[1] if htmlGET and not graph.endswith('.json'): + if graph == 'post': + graph == '_POST' + elif graph == 'get': + graph == '_GET' msg = \ htmlWatchPointsGraph(self.server.baseDir, self.server.fitness, @@ -12695,12 +12699,15 @@ class PubServer(BaseHTTPRequestHandler): return else: graph = graph.replace('.json', '') + if graph == 'post': + graph == '_POST' + elif graph == 'get': + graph == '_GET' watchPointsJson = sortedWatchPoints(self.server.fitness, graph) msg = json.dumps(watchPointsJson, ensure_ascii=False).encode('utf-8') msglen = len(msg) - self._set_headers('application/json', - msglen, + self._set_headers('application/json', msglen, None, callingDomain, False) self._write(msg) fitnessPerformance(GETstartTime, self.server.fitness,