mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:20:42 +00:00
fix: keep Matrix transport tests on mocked fetch
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { fetchWithRuntimeDispatcher } from "openclaw/plugin-sdk/runtime-fetch";
|
||||
import { fetchWithRuntimeDispatcher, isMockedFetch } from "openclaw/plugin-sdk/runtime-fetch";
|
||||
import {
|
||||
closeDispatcher,
|
||||
createPinnedDispatcher,
|
||||
@@ -11,6 +11,7 @@ export {
|
||||
closeDispatcher,
|
||||
createPinnedDispatcher,
|
||||
fetchWithRuntimeDispatcher,
|
||||
isMockedFetch,
|
||||
resolvePinnedHostnameWithPolicy,
|
||||
type PinnedDispatcherPolicy,
|
||||
type SsrFPolicy,
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
closeDispatcher,
|
||||
createPinnedDispatcher,
|
||||
resolvePinnedHostnameWithPolicy,
|
||||
isMockedFetch,
|
||||
type SsrFPolicy,
|
||||
fetchWithRuntimeDispatcher,
|
||||
type PinnedDispatcherPolicy,
|
||||
@@ -93,6 +94,9 @@ async function fetchWithMatrixDispatcher(params: {
|
||||
url: string;
|
||||
init: MatrixDispatcherRequestInit;
|
||||
}): Promise<Response> {
|
||||
if (isMockedFetch(globalThis.fetch)) {
|
||||
return await globalThis.fetch(params.url, params.init);
|
||||
}
|
||||
// Keep this dispatcher-routing logic local to Matrix transport. Shared SSRF
|
||||
// fetches must stay fail-closed unless a retry path can preserve the
|
||||
// validated pinned-address binding. Route dispatcher-attached requests
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
|
||||
export {
|
||||
fetchWithRuntimeDispatcher,
|
||||
isMockedFetch,
|
||||
type DispatcherAwareRequestInit,
|
||||
} from "../infra/net/runtime-fetch.js";
|
||||
|
||||
Reference in New Issue
Block a user