Skip to content

Commit 67354dc

Browse files
authored
[service-utils] remove unneeded cf worker imports (#6409)
1 parent 575b7b3 commit 67354dc

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.changeset/short-breads-teach.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/service-utils": patch
3+
---
4+
5+
[service-utils] remove unneeded cloudflare worker types

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type {
22
ExecutionContext,
33
KVNamespace,
4+
Request,
45
Response,
56
} from "@cloudflare/workers-types";
6-
import type { Request } from "@cloudflare/workers-types";
77
import type { CoreServiceConfig, TeamAndProjectResponse } from "../core/api.js";
88
import { authorize } from "../core/authorize/index.js";
99
import type {

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

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

0 commit comments

Comments
 (0)