Open
Description
Would it be possible to add routing for OPTIONS
POST, GET, PUT, PATCH, DELETE and ANY already exist but the ability to deal with a "pre-flight" OPTIONS request explicitly, would be very useful, like this maybe:
route.options('*', function(req,res) {
var headers = {};
headers["Access-Control-Allow-Origin"] = "*";
headers["Access-Control-Allow-Methods"] = "POST, GET, PUT, DELETE, OPTIONS";
headers["Access-Control-Allow-Credentials"] = true;
headers["Access-Control-Max-Age"] = '86400'; // 24 hours
headers["Access-Control-Allow-Headers"] = "X-Requested-With, Access-Control-Allow-Origin, X-HTTP-Method-Override, Content-Type, Authorization, Accept";
// respond to the request
res.writeHead(200, headers);
res.end();
});
Metadata
Metadata
Assignees
Labels
No labels