-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
There is problem when setting up COARS headers in a middleware before routes middleware:
app.use(function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET, PUT, POST, DELETE, OPTIONS');
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization, Content-Length, X-Requested-With, ACCEPT');
res.header('Access-Control-Allow-Credentials', true);
//intercepts OPTIONS method
if ('OPTIONS' === req.method) {
//respond with 200
res.sendStatus(200);
}
else {
//move on
next();
}
});
require('./routes')(app);
chapar.RPCServer(
app,
config.get("connections.chapar")
);When using Chapar it returns response validation error.
Please consider this and fix it.
Metadata
Metadata
Assignees
Labels
No labels