From 2f9cb987ba14cacb0e3db838f81a13dedb52949e Mon Sep 17 00:00:00 2001 From: Sorrel Bri Date: Sat, 18 Jan 2020 01:30:15 -0800 Subject: [PATCH] add manual set Access Control Allow Origin header --- packages/server/packages/play-node-go/server/server.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/server/packages/play-node-go/server/server.js b/packages/server/packages/play-node-go/server/server.js index 0a85883..b009061 100644 --- a/packages/server/packages/play-node-go/server/server.js +++ b/packages/server/packages/play-node-go/server/server.js @@ -28,6 +28,11 @@ const corsOptions = { app.options('*', cors(corsOptions)); app.use('*', cors(corsOptions)); +app.use((req, res, next) => { + res.header("Access-Control-Allow-Origin", allowedOrigin); + res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); + next(); +}); // disable logging for tests if (process.env.NODE_ENV !== 'test') app.use(logger('dev'));