async function handleRequest()

in bindings/fastly/src/index.ts [250:264]


async function handleRequest(event: FetchEvent): Promise<Response> {
  try {
    const config = recaptchaConfigFromConfigStore("recaptcha");
    const fastly_ctx = new FastlyContext(event, config);
    fastly_ctx.log("debug", "Fastly client JA3MD5: " + event.client.tlsJA3MD5);
    fastly_ctx.log("debug", "Fastly client address " + event.client.address);
    return processRequest(fastly_ctx, new FetchApiRequest(event.request)).then((v) =>
      (v as FetchApiResponse).asResponse(),
    );
    // eslint-disable-next-line  @typescript-eslint/no-unused-vars
  } catch (e) {
    // Default just fetch from origin...
    return fetch(event.request, { backend: "origin" });
  }
}