mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-28 07:36:38 +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());
|
||||
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user