modif cors to allow /
This commit is contained in:
@@ -335,7 +335,7 @@ apxtri.runexpress = async (tribesdns, conf) => {
|
||||
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);
|
||||
} else {
|
||||
console.log(
|
||||
@@ -353,7 +353,7 @@ apxtri.runexpress = async (tribesdns, conf) => {
|
||||
|
||||
app.use((req, res, next) => {
|
||||
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}`);
|
||||
return res.status(403).json({ error: 'CORS not allowed', origin });
|
||||
}
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
"xlang",
|
||||
"xtribe",
|
||||
"xapp",
|
||||
"xuuid"
|
||||
"xuuid",
|
||||
"xprofils",
|
||||
"xtrkversion"
|
||||
],
|
||||
"appset": {
|
||||
"trust proxy": true
|
||||
|
||||
Reference in New Issue
Block a user