chore(tlon): remove inert SSRF policy helper · openclaw/openclaw@9c85b81
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,6 @@ import {
|
10 | 10 | saveRemoteMedia, |
11 | 11 | } from "openclaw/plugin-sdk/media-runtime"; |
12 | 12 | import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime"; |
13 | | -import { getDefaultSsrFPolicy } from "../urbit/context.js"; |
14 | 13 | |
15 | 14 | const MAX_IMAGES_PER_MESSAGE = 8; |
16 | 15 | const TLON_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS = 30_000; |
@@ -72,7 +71,7 @@ export async function downloadMedia(
|
72 | 71 | url, |
73 | 72 | maxBytes: MAX_IMAGE_BYTES, |
74 | 73 | readIdleTimeoutMs: TLON_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS, |
75 | | -ssrfPolicy: getDefaultSsrFPolicy(), |
| 74 | +ssrfPolicy: undefined, |
76 | 75 | requestInit: { method: "GET" }, |
77 | 76 | }; |
78 | 77 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -40,12 +40,3 @@ export function getUrbitContext(url: string, ship?: string): UrbitContext {
|
40 | 40 | ship: normalizeUrbitShip(ship, validated.hostname), |
41 | 41 | }; |
42 | 42 | } |
43 | | - |
44 | | -/** |
45 | | - * Get the default SSRF policy for image uploads. |
46 | | - * Uses a restrictive policy that blocks private networks by default. |
47 | | - */ |
48 | | -export function getDefaultSsrFPolicy(): undefined { |
49 | | -// Default: block private networks for image uploads (safer default) |
50 | | -return undefined; |
51 | | -} |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,6 @@
|
3 | 3 | */ |
4 | 4 | import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime"; |
5 | 5 | import { uploadFile } from "../tlon-api.js"; |
6 | | -import { getDefaultSsrFPolicy } from "./context.js"; |
7 | 6 | |
8 | 7 | /** |
9 | 8 | * Fetch an image from a URL and upload it to Tlon storage. |
@@ -25,7 +24,7 @@ export async function uploadImageFromUrl(imageUrl: string): Promise<string> {
|
25 | 24 | const { response, release } = await fetchWithSsrFGuard({ |
26 | 25 | url: imageUrl, |
27 | 26 | init: { method: "GET" }, |
28 | | -policy: getDefaultSsrFPolicy(), |
| 27 | +policy: undefined, |
29 | 28 | auditContext: "tlon-upload-image", |
30 | 29 | }); |
31 | 30 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。