Browse Source

Merge branch 'fix-cors' into 'develop'

Added more header to allow proper cors

See merge request dojo/samourai-dojo!141
use-env-var-docker
kenshin-samourai 5 years ago
parent
commit
0a119c95ec
  1. 4
      lib/http-server/http-server.js

4
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()
}

Loading…
Cancel
Save