mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-30 01:47:22 +08:00
fixed resource order and update bug
This commit is contained in:
@@ -28,8 +28,16 @@ middleware.listen = function (callback) {
|
||||
|
||||
// remote flag
|
||||
server.use(function (req, res, next) {
|
||||
res.header("Access-Control-Allow-Origin", '*');
|
||||
res.header('Access-Control-Allow-Credentials', 'true');
|
||||
res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
|
||||
req.isRemote = true;
|
||||
next();
|
||||
if(req.method === 'OPTIONS') {
|
||||
res.header("Access-Control-Allow-Headers", req.header("Access-Control-Request-Headers"));
|
||||
res.send('ok');
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
||||
// proxy requests into the current mdoq stack
|
||||
|
||||
Reference in New Issue
Block a user