Merge pull request #167 from veladon/pr/3

fix for stats exporter console errors
This commit is contained in:
Godmave authored and GitHub committed 2019-07-15 15:05:21 +02:00
commit 773a2c412e
1 file changed
+4 -1
@@ -26,7 +26,10 @@ class masterPlugin {
@returns {string} failure
*/
app.post("/api/logStats", authenticate.middleware, function(req,res) {
let data = JSON.parse(req.body.forceData);
let data = req.body.forceData;
if(typeof req.body.forceData == "string") {
data = JSON.parse(req.body.forceData);
}
// endpointHitCounter.labels(req.route.path).inc();
if(typeof req.body == "object"
&& req.body.instanceID