mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-04-28 17:35:50 +08:00
add the X-Requested-With header to fix AngularJs's ajax request
This commit is contained in:
@@ -18,6 +18,7 @@ exports.setup = function(req, res, next) {
|
||||
corsOpts.supportsCredentials = false;
|
||||
}
|
||||
|
||||
corsOpts.requestHeaders = corser.simpleRequestHeaders.concat(["X-Requested-With"]);
|
||||
var handler = corser.create(corsOpts);
|
||||
|
||||
handler(req, res, function () {
|
||||
@@ -130,4 +131,4 @@ exports.redirect = function(res, url, statusCode) {
|
||||
var autoParse = {
|
||||
'application/x-www-form-urlencoded': parseBody,
|
||||
'application/json': parseBody
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user