server.js aktualisiert
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c07984c506
commit
cd7e2e7a0f
@ -101,11 +101,11 @@ app.use(fileUpload({
|
|||||||
}));
|
}));
|
||||||
const corsOptions = {
|
const corsOptions = {
|
||||||
origin: (origin, callback) => {
|
origin: (origin, callback) => {
|
||||||
if (!origin || config.allowed_domains.indexOf(origin.replace(/:\d*$/g, "")) !== -1) {
|
if (!origin || config.domain == origin.replace(/:\d*$/g, "") || config.allowed_domains.indexOf(origin.replace(/:\d*$/g, "")) !== -1) {
|
||||||
callback(null, true);
|
callback(null, true);
|
||||||
} else {
|
} else {
|
||||||
database.system.domains((domains) => {
|
database.system.domains((domains) => {
|
||||||
if (config.domain == origin.replace(/:\d*$/g, "") || domains.indexOf(origin.replace(/:\d*$/g, "")) !== -1) {
|
if (domains.indexOf(origin.replace(/:\d*$/g, "")) !== -1) {
|
||||||
callback(null, true);
|
callback(null, true);
|
||||||
} else {
|
} else {
|
||||||
callback("Origin not allowed: " + origin);
|
callback("Origin not allowed: " + origin);
|
||||||
|
Loading…
Reference in New Issue
Block a user