modif cors to allow /
This commit is contained in:
@@ -335,7 +335,7 @@ apxtri.runexpress = async (tribesdns, conf) => {
|
|||||||
return callback(null, true);
|
return callback(null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (regorigin.test(origin) || allowedOrigins.includes(origin)) {
|
if (regorigin.test(origin) || allowedOrigins.includes(origin) || allowedOrigins.includes(origin.replace(/\/$/, ''))) {
|
||||||
return callback(null, true);
|
return callback(null, true);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
@@ -353,7 +353,7 @@ apxtri.runexpress = async (tribesdns, conf) => {
|
|||||||
|
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
const origin = req.headers.origin;
|
const origin = req.headers.origin;
|
||||||
if (origin && !regorigin.test(origin) && !allowedOrigins.includes(origin)) {
|
if (origin && !regorigin.test(origin) && !allowedOrigins.includes(origin) && !allowedOrigins.includes(origin.replace(/\/$/, ''))) {
|
||||||
console.log(`CORS blocked: ${origin}`);
|
console.log(`CORS blocked: ${origin}`);
|
||||||
return res.status(403).json({ error: 'CORS not allowed', origin });
|
return res.status(403).json({ error: 'CORS not allowed', origin });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,9 @@
|
|||||||
"xlang",
|
"xlang",
|
||||||
"xtribe",
|
"xtribe",
|
||||||
"xapp",
|
"xapp",
|
||||||
"xuuid"
|
"xuuid",
|
||||||
|
"xprofils",
|
||||||
|
"xtrkversion"
|
||||||
],
|
],
|
||||||
"appset": {
|
"appset": {
|
||||||
"trust proxy": true
|
"trust proxy": true
|
||||||
|
|||||||
Reference in New Issue
Block a user