From a8973d259c157bb104b9e8ae11de9dfb0956405d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20=C5=A0ev=C4=8D=C3=ADk?= Date: Tue, 2 Jun 2020 00:30:48 +0200 Subject: [PATCH] added more header to allow proper cors --- lib/http-server/http-server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/http-server/http-server.js b/lib/http-server/http-server.js index 9575439..d5e1600 100644 --- a/lib/http-server/http-server.js +++ b/lib/http-server/http-server.js @@ -145,7 +145,7 @@ class HttpServer { } /** - * Express middleware returnsing a json response + * Express middleware returnsing a json response * @param {object} req - http request object * @param {object} res - http response object * @param {function} next - next middleware @@ -163,6 +163,8 @@ class HttpServer { */ static setCrossOrigin(req, res, next) { res.set('Access-Control-Allow-Origin', '*') + res.set('Access-Control-Allow-Methods', 'GET,HEAD,POST,DELETE') + res.set('Access-Control-Allow-Headers', 'Content-Type,Authorization,Accept') next() }