mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-04 22:32:12 +03:00
Integrated into release/v3.8.2
This commit is contained in:
committed by
GitHub
parent
58356ac19b
commit
901827df7f
@@ -1,4 +1,5 @@
|
||||
import { isIP } from "node:net";
|
||||
import { resolveFeatureFlag } from "@/shared/utils/featureFlags";
|
||||
|
||||
const TRUE_ENV_VALUES = new Set(["1", "true", "yes", "on"]);
|
||||
|
||||
@@ -128,6 +129,14 @@ export function arePrivateProviderUrlsAllowed() {
|
||||
if (legacyValue && ["false", "0", "no", "off"].includes(legacyValue.trim().toLowerCase()))
|
||||
return true;
|
||||
|
||||
// Check feature flag DB override — supports runtime toggle without restart
|
||||
try {
|
||||
const dbValue = resolveFeatureFlag(PRIVATE_PROVIDER_URLS_ENV);
|
||||
if (dbValue && TRUE_ENV_VALUES.has(dbValue.trim().toLowerCase())) return true;
|
||||
} catch {
|
||||
// DB not initialized yet — fall back to env-only check
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user