mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-15 03:01:02 +00:00
fix(browser): keep legacy ssrf alias raw-config only
This commit is contained in:
@@ -42,6 +42,14 @@ export {
|
||||
export type { BrowserControlAuth };
|
||||
export { parseBrowserHttpUrl as parseHttpUrl };
|
||||
|
||||
type BrowserSsrFPolicyCompat = NonNullable<BrowserConfig["ssrfPolicy"]> & {
|
||||
/**
|
||||
* Legacy raw-config alias. Keep it out of the public BrowserConfig type while
|
||||
* still accepting old user files until doctor rewrites them.
|
||||
*/
|
||||
allowPrivateNetwork?: boolean;
|
||||
};
|
||||
|
||||
export type ResolvedBrowserConfig = {
|
||||
enabled: boolean;
|
||||
evaluateEnabled: boolean;
|
||||
@@ -119,9 +127,7 @@ function resolveCdpPortRangeStart(
|
||||
const normalizeStringList = normalizeOptionalTrimmedStringList;
|
||||
|
||||
function resolveBrowserSsrFPolicy(cfg: BrowserConfig | undefined): SsrFPolicy | undefined {
|
||||
const rawPolicy = cfg?.ssrfPolicy as
|
||||
| (BrowserConfig["ssrfPolicy"] & { allowPrivateNetwork?: boolean })
|
||||
| undefined;
|
||||
const rawPolicy = cfg?.ssrfPolicy as BrowserSsrFPolicyCompat | undefined;
|
||||
const allowPrivateNetwork = rawPolicy?.allowPrivateNetwork;
|
||||
const dangerouslyAllowPrivateNetwork = rawPolicy?.dangerouslyAllowPrivateNetwork;
|
||||
const allowedHostnames = normalizeStringList(rawPolicy?.allowedHostnames);
|
||||
|
||||
Reference in New Issue
Block a user