fix: exclude test support from raw fetch guard

This commit is contained in:
Peter Steinberger
2026-04-29 08:36:00 +01:00
parent a31342ab6b
commit f8faf40a9e

View File

@@ -18,8 +18,6 @@ const allowedRawFetchCallsites = new Set([
bundledPluginCallsite("bluebubbles", "src/types.ts", 204),
bundledPluginCallsite("browser", "src/browser/cdp.helpers.ts", 268),
bundledPluginCallsite("browser", "src/browser/client-fetch.ts", 192),
bundledPluginCallsite("browser", "src/browser/test-fetch.ts", 24),
bundledPluginCallsite("browser", "src/browser/test-fetch.ts", 27),
bundledPluginCallsite("chutes", "models.ts", 535),
bundledPluginCallsite("chutes", "models.ts", 542),
bundledPluginCallsite("discord", "src/monitor/gateway-plugin.ts", 417),
@@ -96,6 +94,7 @@ export async function main() {
sourceRoots,
extraTestSuffixes: [".browser.test.ts", ".node.test.ts"],
findCallLines: findRawFetchCallLines,
skipRelativePath: (relPath) => relPath.includes("/test-support/"),
allowCallsite: (callsite) => allowedRawFetchCallsites.has(callsite),
header: "Found raw fetch() usage in channel/plugin runtime sources outside allowlist:",
footer: "Use fetchWithSsrFGuard() or existing channel/plugin SDK wrappers for network calls.",