Permalink
Browse files

* Allow Content-Type on POST

  • Loading branch information...
1 parent 7f4341f commit 5289ef9294c8be6af36d3cf8b129a287fd9eea0c @audreyt committed Mar 29, 2013
Showing with 4 additions and 2 deletions.
  1. +2 −1 main.js
  2. +2 −1 src/main.ls
View
@@ -36,7 +36,8 @@
console.log("Cross-Origin Resource Sharing (CORS) enabled.");
this.all('*', function(req, res, next){
this.response.header('Access-Control-Allow-Origin', '*');
- this.response.header('Access-Control-Allow-Headers', 'X-Requested-With');
+ this.response.header('Access-Control-Allow-Headers', 'X-Requested-With,Content-Type,If-Modified-Since');
+ this.response.header('Access-Control-Allow-Methods', 'GET,POST,PUT');
if ((req != null ? req.method : void 8) === 'OPTIONS') {
return res.send(204);
}
View
@@ -35,7 +35,8 @@
console.log "Cross-Origin Resource Sharing (CORS) enabled."
@all \* (req, res, next) ->
@response.header \Access-Control-Allow-Origin \*
- @response.header \Access-Control-Allow-Headers \X-Requested-With
+ @response.header \Access-Control-Allow-Headers 'X-Requested-With,Content-Type,If-Modified-Since'
+ @response.header \Access-Control-Allow-Methods 'GET,POST,PUT'
return res.send(204) if req?method is \OPTIONS
next!

0 comments on commit 5289ef9

Please sign in to comment.