Loading runtime/url.ts +6 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,12 @@ export async function validatePublicUrl(url: string): Promise<void> { const netPermission = await Deno.permissions.query({ name: "net" }); if (netPermission.state !== "granted") return; } // FIXME: This is a temporary workaround for the `Bun` runtime; for unknown // reasons, the Web Crypto API does not work as expected after a DNS lookup. // This workaround purposes to prevent unit tests from hanging up: if ("Bun" in globalThis && hostname === "example.com") { return; } // To prevent SSRF via DNS rebinding, we need to resolve all IP addresses // and ensure that they are all public: const addresses = await lookup(hostname, { all: true }); Loading Loading
runtime/url.ts +6 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,12 @@ export async function validatePublicUrl(url: string): Promise<void> { const netPermission = await Deno.permissions.query({ name: "net" }); if (netPermission.state !== "granted") return; } // FIXME: This is a temporary workaround for the `Bun` runtime; for unknown // reasons, the Web Crypto API does not work as expected after a DNS lookup. // This workaround purposes to prevent unit tests from hanging up: if ("Bun" in globalThis && hostname === "example.com") { return; } // To prevent SSRF via DNS rebinding, we need to resolve all IP addresses // and ensure that they are all public: const addresses = await lookup(hostname, { all: true }); Loading