fix: harden bluebubbles short ids and fetch wrapper (#1369) (thanks @tyler6204)
This commit is contained in:
@@ -6,7 +6,6 @@ import { runNodeHost } from "../../node-host/runner.js";
|
||||
import {
|
||||
runNodeDaemonInstall,
|
||||
runNodeDaemonRestart,
|
||||
runNodeDaemonStart,
|
||||
runNodeDaemonStatus,
|
||||
runNodeDaemonStop,
|
||||
runNodeDaemonUninstall,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user