From 505400d1f48bf27e9cb15904ea10c214abfae530 Mon Sep 17 00:00:00 2001 From: velvettear Date: Fri, 11 Feb 2022 21:02:45 +0100 Subject: [PATCH] add 'CORS' header to server responses --- libs/server.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/server.js b/libs/server.js index ada0118..aeeacb4 100644 --- a/libs/server.js +++ b/libs/server.js @@ -78,6 +78,8 @@ function endRequest(request, response, msg, code) { object.data = msg; } } + response.setHeader("Access-Control-Allow-Origin", "*"); + response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); response.writeHead(object.code); response.end(object.data); logger.http(object);