Tune the list of allowed headers for CORS
MODIFY
lib/express/middleware.js
lib/express/middleware.js
@@ -6,18 +6,16 @@ function allowCrossDomain (req, res, next) {
try {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, OPTIONS, DELETE');
- res.header('Access-Control-Allow-Headers', 'origin, content-type, accept');
+ res.header('Access-Control-Allow-Headers', 'Cache-Control, Pragma, Origin, X-Requested-With, Content-Type, Accept');
// need to respond 200 to OPTIONS
if ('OPTIONS' === req.method) {
- res.sendStatus(200);
- } else {
- next();
+ return res.sendStatus(200);
}
} catch (err) {
log.error(`Unexpected error: ${err.stack}`);
- next();
}
+ next();
}
function fixPythonContentType (req, res, next) {

Tune the list of allowed headers for CORS (#293)