From 2c5e4ae452c336a29c5f3a84350b501250904641 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 13 Sep 2019 16:27:43 +0200 Subject: [PATCH] CORS --- core/express.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/express.js b/core/express.js index cfd2e75..1b47313 100644 --- a/core/express.js +++ b/core/express.js @@ -43,14 +43,20 @@ app.use(methodOverride()); app.use(helmet()); // enable CORS - Cross Origin Resource Sharing -var allowedOrigins = ['http://localhost:8080', 'http://127.0.0.1:8080', 'https://adminapp2.loquedeverdadimporta.org']; +//var allowedOrigins = ['http://localhost:8080', 'http://127.0.0.1:8080', 'https://adminapp2.loquedeverdadimporta.org']; +// enable CORS - Cross Origin Resource Sharing app.use(cors({ + exposedHeaders: ['Content-Disposition', 'Content-Type', 'Content-Length'], +})); + + +/*app.use(cors({ origin: function (origin, callback) { // allow requests with no origin // (like mobile apps or curl requests) return callback(null, true); - + if (!origin) { return callback(null, true); } @@ -65,7 +71,7 @@ app.use(cors({ return callback(null, true); } -})); +}));*/ /*app.use(cors({