Browse Source
added more header to allow proper cors
use-env-var-docker
Pavel Ševčík
5 years ago
No known key found for this signature in database
GPG Key ID: D3B8A90B4072D9DB
1 changed files with
3 additions and
1 deletions
-
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() |
|
|
|
} |
|
|
|
|
|
|
|