From 2d98b4fca1eb2544fec728f7c1c7b0d450e0dbee Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Sat, 19 Feb 2022 01:31:03 -0500 Subject: [PATCH] Added Cloudflare Worker support (#1886). --- packages/web/src.ts/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/web/src.ts/index.ts b/packages/web/src.ts/index.ts index 4d78ef0cf..92ac6ccbb 100644 --- a/packages/web/src.ts/index.ts +++ b/packages/web/src.ts/index.ts @@ -49,6 +49,8 @@ export type ConnectionInfo = { throttleSlotInterval?: number; throttleCallback?: (attempt: number, url: string) => Promise, + skipFetchSetup?: boolean; + timeout?: number, }; @@ -149,6 +151,10 @@ export function _fetchData(connection: string | ConnectionInfo, value: "Basic " + base64Encode(toUtf8Bytes(authorization)) }; } + + if (connection.skipFetchSetup != null) { + options.skipFetchSetup = !!connection.skipFetchSetup; + } } const reData = new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$", "i"); const dataMatch = ((url) ? url.match(reData): null);