diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-12-03 16:05:24 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-12-03 16:05:24 +0200 |
commit | b788deb002aab83fc127d1a8b3f47670258dbb6a (patch) | |
tree | b5002784383ddc73258af9f2b68babd548c0be65 /server/cors.js | |
parent | fa6b2e567910c5dbe007ab3482a64c9007614788 (diff) | |
download | wekan-b788deb002aab83fc127d1a8b3f47670258dbb6a.tar.gz wekan-b788deb002aab83fc127d1a8b3f47670258dbb6a.tar.bz2 wekan-b788deb002aab83fc127d1a8b3f47670258dbb6a.zip |
- Add CORS https://enable-cors.org/server_meteor.html
- Add missing LDAP and TIMER environment variables.
Thanks to xet7 !
Closes wekan/wekan-snap#69
Diffstat (limited to 'server/cors.js')
-rw-r--r-- | server/cors.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/cors.js b/server/cors.js new file mode 100644 index 00000000..80369a83 --- /dev/null +++ b/server/cors.js @@ -0,0 +1,11 @@ +Meteor.startup(() => { + + if ( process.env.CORS ) { + // Listen to incoming HTTP requests, can only be used on the server + WebApp.rawConnectHandlers.use(function(req, res, next) { + res.setHeader('Access-Control-Allow-Origin', process.env.CORS); + return next(); + }); + } + +}); |