Skip to content

Commit

Permalink
Merge pull request #273 from skrenek/master
Browse files Browse the repository at this point in the history
CORS changes
  • Loading branch information
skrenek committed Feb 28, 2014
2 parents 0125cae + eabeee4 commit b0ce7b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ exports.getMiddleware = function(options, cb) {
var pattern = new RegExp(routeRegex);
if (req.url.match(pattern)){
res.setHeader("Access-Control-Allow-Origin", req.headers.origin);
res.setHeader("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Authorization");
res.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
return true;
}

Expand Down

0 comments on commit b0ce7b6

Please sign in to comment.