feat: warn about unsafe CORS (#12773)

* feat: warn about unsafe CORS

* extend docs

* fix defaults

* bump api version

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
Matthias MairandOliver authored and GitHub committed 2026-09-03 13:09:17 +10:00
1 parent 9f8dfda18b
commit fa52affe98
6 files changed
+28 -2

No files matched your search

@@ -149,6 +149,13 @@ export function getAlerts(
code: 'INVE-W8',
message: t`There are pending database migrations.`,
condition: n_migrations > 0
},
{
key: 'cors',
title: t`CORS Settings`,
code: 'INVE-W16',
message: t`CORS is set to allow all origins.`,
condition: server?.system_state?.cors_allow_all || false
}
];
+2 -1
View File
@@ -21,7 +21,8 @@ export const emptyServerAPI = {
default_locale: null,
django_admin: null,
settings: null,
customize: null
customize: null,
system_state: null
};
export interface SiteMarkProps {
+3
View File
@@ -40,6 +40,9 @@ export interface ServerAPIProps {
navbar_message: string;
disable_theme_storage: boolean;
};
system_state: {
cors_allow_all: null | boolean;
} | null;
}
let pendingGlobalStatesFetch: Promise<void> | null = null;