Skip to content

Commit 915415b

Browse files
committed
shallow copy headers without importing cf worker
1 parent 2657776 commit 915415b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/service-utils/src/cf-worker/usageV2.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { Request } from "@cloudflare/workers-types";
12
import type { CoreAuthInput } from "../core/types.js";
23
import type {
34
ClientUsageV2Event,
@@ -33,7 +34,7 @@ export async function sendUsageV2Events<T extends UsageV2Options>(
3334
// Forward headers from the origin request.
3435
// Determine endpoint and auth header based on provided credentials.
3536
let url: string;
36-
const headers = new Headers(authInput.req.headers);
37+
const headers = new Headers(Object.fromEntries(authInput.req.headers));
3738
headers.set("Content-Type", "application/json");
3839
if (serviceKey) {
3940
// If a service key is provided, call the non-public usage endpoint.

0 commit comments

Comments
 (0)