remove duplicate headers definition
This commit is contained in:
parent
e7badc7651
commit
c958b4430f
@ -36,11 +36,6 @@ module.exports = function(app, historicSync, peerSync) {
|
|||||||
|
|
||||||
if (config.enableEmailstore) {
|
if (config.enableEmailstore) {
|
||||||
var allowCopayCrossDomain = function(req, res, next) {
|
var allowCopayCrossDomain = function(req, res, next) {
|
||||||
res.header('Access-Control-Allow-Origin', '*');
|
|
||||||
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
|
|
||||||
res.header('Access-Control-Allow-Headers', 'Content-Type,Authorization');
|
|
||||||
|
|
||||||
|
|
||||||
if ('OPTIONS' == req.method) {
|
if ('OPTIONS' == req.method) {
|
||||||
res.send(200);
|
res.send(200);
|
||||||
res.end();
|
res.end();
|
||||||
|
|||||||
@ -6,8 +6,8 @@ module.exports = function(app) {
|
|||||||
|
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||||
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
|
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, DELETE');
|
||||||
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
|
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,Content-Type,Authorization');
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user