mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Trying more tests to avoid cookie being deleted
This commit is contained in:
@@ -73,6 +73,12 @@ app.get('/robots.txt', function (req, res) {
|
|||||||
|
|
||||||
app.use(function (req, res, next) {
|
app.use(function (req, res, next) {
|
||||||
var cookie = req.cookies._uI;
|
var cookie = req.cookies._uI;
|
||||||
|
var skipElements = ["/_embed", "/assets/manifest.json", "/apple-touch-icon.png"];
|
||||||
|
if(skipElements.indexOf(req.originalUrl) > -1) {
|
||||||
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
|
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||||
|
next();
|
||||||
|
} else {
|
||||||
if(req.originalUrl.split("/").length > 3) {
|
if(req.originalUrl.split("/").length > 3) {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||||
@@ -106,6 +112,7 @@ app.use(function (req, res, next) {
|
|||||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use('/service-worker.js', function(req, res) {
|
app.use('/service-worker.js', function(req, res) {
|
||||||
|
|||||||
Reference in New Issue
Block a user