fix: harden bluebubbles short ids and fetch wrapper (#1369) (thanks @tyler6204)

This commit is contained in:
Peter Steinberger
2026-01-21 17:05:36 +00:00
parent c3adc50cb2
commit cd25d69b4d
10 changed files with 136 additions and 11 deletions

View File

@@ -6,7 +6,6 @@ import { runNodeHost } from "../../node-host/runner.js";
import {
runNodeDaemonInstall,
runNodeDaemonRestart,
runNodeDaemonStart,
runNodeDaemonStatus,
runNodeDaemonStop,
runNodeDaemonUninstall,

View File

@@ -1,5 +1,5 @@
export function wrapFetchWithAbortSignal(fetchImpl: typeof fetch): typeof fetch {
return (input: RequestInfo | URL, init?: RequestInit) => {
const wrapped = ((input: RequestInfo | URL, init?: RequestInit) => {
const signal = init?.signal;
if (!signal) return fetchImpl(input, init);
if (typeof AbortSignal !== "undefined" && signal instanceof AbortSignal) {
@@ -25,5 +25,6 @@ export function wrapFetchWithAbortSignal(fetchImpl: typeof fetch): typeof fetch
});
}
return response;
};
}) as typeof fetch;
return Object.assign(wrapped, fetchImpl);
}