mirror of
https://github.com/unraid/api.git
synced 2026-01-08 09:39:49 -06:00
chore: add CORS debug logs
This commit is contained in:
@@ -91,12 +91,14 @@ app.use(cors({
|
||||
// Disallow requests with no origin
|
||||
// (like mobile apps or curl requests)
|
||||
if (!origin) {
|
||||
log.debug('No origin provided, denying CORS!');
|
||||
callback(new Error(invalidOrigin), false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Only allow known origins
|
||||
if (!allowedOrigins.includes(origin)) {
|
||||
log.debug(`Checking "${origin}" for CORS access.`);
|
||||
callback(new Error(invalidOrigin), false);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user