Skip to content

Commit

Permalink
Merge pull request #30 from nsonanh/feature-cors-update
Browse files Browse the repository at this point in the history
[feature-cors-update] Update cors to accept x-access-token header
  • Loading branch information
nsonanh committed Jul 13, 2017
2 parents b33e3e3 + 4bbfa39 commit 604a921
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/cors.js
Expand Up @@ -3,8 +3,12 @@
module.exports = function() {
return function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Methods", "GET");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
res.header("Access-Control-Allow-Methods", "GET, POST");

res.header("Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type," +
"Accept, x-access-token");

// do logging
console.log('Received request...');
next(); // make sure we go to the next routes and don't stop here
Expand Down

0 comments on commit 604a921

Please sign in to comment.