Skip to content

Commit

Permalink
Added Cloudflare Worker support (ethers-io#1886).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo authored and Woodpile37 committed Jan 14, 2024
1 parent c756e25 commit f11ab46
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/web/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export type ConnectionInfo = {
throttleSlotInterval?: number;
throttleCallback?: (attempt: number, url: string) => Promise<boolean>,

skipFetchSetup?: boolean;

timeout?: number,
};

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f11ab46

Please sign in to comment.