diff --git a/worker/src/index.ts b/worker/src/index.ts index 7bdc0ddb4e..0271517bd0 100644 --- a/worker/src/index.ts +++ b/worker/src/index.ts @@ -8,6 +8,7 @@ export interface Env { SUPABASE_SERVICE_ROLE_KEY: string; SUPABASE_URL: string; TOKENIZER_COUNT_API: string; + TOKEN_COUNT_URL: string; RATE_LIMIT_KV: KVNamespace; CLICKHOUSE_HOST: string; CLICKHOUSE_USER: string; diff --git a/worker/src/lib/HeliconeProxyRequest/forwarder.ts b/worker/src/lib/HeliconeProxyRequest/forwarder.ts index ceda544a82..cab811dd9b 100644 --- a/worker/src/lib/HeliconeProxyRequest/forwarder.ts +++ b/worker/src/lib/HeliconeProxyRequest/forwarder.ts @@ -134,5 +134,6 @@ export async function proxyForwarder( return responseBuilder.build({ body: response.body, inheritFrom: response, + status: response.status, }); } diff --git a/worker/src/lib/ResponseBuilder.ts b/worker/src/lib/ResponseBuilder.ts index f52477499b..fe2511f97d 100644 --- a/worker/src/lib/ResponseBuilder.ts +++ b/worker/src/lib/ResponseBuilder.ts @@ -2,7 +2,7 @@ import { RateLimitOptions, RateLimitResponse } from "../rateLimit"; export interface BuildParams { body: BodyInit | null; - status?: number; + status: number; inheritFrom?: Response; } @@ -36,8 +36,7 @@ export class ResponseBuilder { } build(params: BuildParams): Response { - const { body, inheritFrom: _inheritFrom, status: _status } = params; - const status = _status ?? 200; + const { body, inheritFrom: _inheritFrom, status } = params; const inheritFrom = _inheritFrom ?? new Response(); const headers = new Headers(inheritFrom.headers);