pusher: add missing Content-Type header for json responses

This commit is contained in:
Ludwig Behm
2022-02-12 22:19:48 +01:00
parent 55c2c2e555
commit 9073024b1d
2 changed files with 8 additions and 0 deletions
+3
View File
@@ -47,6 +47,7 @@ export class MapController extends BaseController {
if (!match) {
res.writeStatus("404 Not Found");
this.addCorsHeaders(res);
res.writeHeader('Content-Type', 'application/json');
res.end(JSON.stringify({}));
return;
}
@@ -55,6 +56,7 @@ export class MapController extends BaseController {
res.writeStatus("200 OK");
this.addCorsHeaders(res);
res.writeHeader('Content-Type', 'application/json');
res.end(
JSON.stringify({
mapUrl,
@@ -106,6 +108,7 @@ export class MapController extends BaseController {
res.writeStatus("200 OK");
this.addCorsHeaders(res);
res.writeHeader('Content-Type', 'application/json');
res.end(JSON.stringify(mapDetails));
} catch (e) {
this.errorToResponse(e, res);