mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-06 01:56:37 +08:00
fix: stop caching sensitive configs in browser
This commit is contained in:
@@ -307,7 +307,17 @@ export const updateSiteConfig = async (configMap?: Record<string, string>) => {
|
|||||||
const resolvedConfigMap = configMap ?? (await getCachedConfigs());
|
const resolvedConfigMap = configMap ?? (await getCachedConfigs());
|
||||||
|
|
||||||
Object.entries(resolvedConfigMap).forEach(([key, value]) => {
|
Object.entries(resolvedConfigMap).forEach(([key, value]) => {
|
||||||
configCache.set(key, String(value));
|
const normalizedKey = key.trim().toLowerCase();
|
||||||
|
|
||||||
|
if (SENSITIVE_CONFIG_KEYS.has(normalizedKey)) {
|
||||||
|
configCache.remove(normalizedKey);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldPersistConfigKey(normalizedKey)) {
|
||||||
|
configCache.set(normalizedKey, String(value));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const hasAppName = Object.prototype.hasOwnProperty.call(
|
const hasAppName = Object.prototype.hasOwnProperty.call(
|
||||||
|
|||||||
Reference in New Issue
Block a user