Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* Allow Content-Type on POST

  • Loading branch information...
commit 5289ef9294c8be6af36d3cf8b129a287fd9eea0c 1 parent 7f4341f
@audreyt authored
Showing with 4 additions and 2 deletions.
  1. +2 −1  main.js
  2. +2 −1  src/main.ls
View
3  main.js
@@ -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
3  src/main.ls
@@ -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!
Please sign in to comment.
Something went wrong with that request. Please try again.