From 27ef00705b09e70d094ff2f012080d2ba4867c40 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sun, 22 Mar 2020 02:01:54 +0100 Subject: [PATCH] Set content type for /api/inventory Set the correct content type to JSON to for the /api/inventory endpoints. --- plugins/subspace_storage/routes.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/subspace_storage/routes.js b/plugins/subspace_storage/routes.js index 9bcfdc2a..de0687c6 100644 --- a/plugins/subspace_storage/routes.js +++ b/plugins/subspace_storage/routes.js @@ -29,6 +29,7 @@ function addApiRoutes(app, items, endpointHitCounter) { for (let [name, count] of items._items) { inventory.push({ name, count }); } + res.type("json"); res.send(JSON.stringify(inventory)); }); @@ -45,6 +46,7 @@ function addApiRoutes(app, items, endpointHitCounter) { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); // Check it and send it + res.type("json"); res.send(JSON.stringify(items.serialise())); }); }