feat: default browser ssrfPolicy to allow private network access (#860)
This commit is contained in:
committed by
GitHub
Unverified
parent
1f39d1a8a7
commit
2fefbf3aba
@@ -1188,6 +1188,18 @@ export async function syncBrowserConfigToOpenClaw(): Promise<void> {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
// Default ssrfPolicy to allow private network access for enterprise/internal use
|
||||
if (browser.ssrfPolicy == null) {
|
||||
browser.ssrfPolicy = { dangerouslyAllowPrivateNetwork: true };
|
||||
changed = true;
|
||||
} else if (
|
||||
typeof browser.ssrfPolicy === 'object' &&
|
||||
(browser.ssrfPolicy as Record<string, unknown>).dangerouslyAllowPrivateNetwork === undefined
|
||||
) {
|
||||
(browser.ssrfPolicy as Record<string, unknown>).dangerouslyAllowPrivateNetwork = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (!changed) return;
|
||||
|
||||
config.browser = browser;
|
||||
@@ -1294,6 +1306,19 @@ export async function batchSyncConfigFields(token: string): Promise<void> {
|
||||
config.browser = browser;
|
||||
modified = true;
|
||||
}
|
||||
// Default ssrfPolicy to allow private network access for enterprise/internal use
|
||||
if (browser.ssrfPolicy == null) {
|
||||
browser.ssrfPolicy = { dangerouslyAllowPrivateNetwork: true };
|
||||
config.browser = browser;
|
||||
modified = true;
|
||||
} else if (
|
||||
typeof browser.ssrfPolicy === 'object' &&
|
||||
(browser.ssrfPolicy as Record<string, unknown>).dangerouslyAllowPrivateNetwork === undefined
|
||||
) {
|
||||
(browser.ssrfPolicy as Record<string, unknown>).dangerouslyAllowPrivateNetwork = true;
|
||||
config.browser = browser;
|
||||
modified = true;
|
||||
}
|
||||
|
||||
// ── Session idle minutes ──
|
||||
const session = (
|
||||
|
||||
Reference in New Issue
Block a user