Added Cloudflare Worker support (#1886).
This commit is contained in:
parent
f26074b92b
commit
2d98b4fca1
@ -49,6 +49,8 @@ export type ConnectionInfo = {
|
||||
throttleSlotInterval?: number;
|
||||
throttleCallback?: (attempt: number, url: string) => Promise<boolean>,
|
||||
|
||||
skipFetchSetup?: boolean;
|
||||
|
||||
timeout?: number,
|
||||
};
|
||||
|
||||
@ -149,6 +151,10 @@ export function _fetchData<T = Uint8Array>(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);
|
||||
|
Loading…
Reference in New Issue
Block a user