mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-18 14:07:41 +00:00
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:
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
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user