From c2c0108e4fd7f6595f7ddda547b46f713fa301c3 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 15 Feb 2024 16:12:47 +0000 Subject: [PATCH] Fix build (again). --- packages/server/src/utilities/workerRequests.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/server/src/utilities/workerRequests.ts b/packages/server/src/utilities/workerRequests.ts index acf7515784..def3ffe9cf 100644 --- a/packages/server/src/utilities/workerRequests.ts +++ b/packages/server/src/utilities/workerRequests.ts @@ -75,9 +75,13 @@ export function createRequest(request: Request): RequestInit { const cookie = ctx.headers[constants.Header.COOKIE], apiKey = ctx.headers[constants.Header.API_KEY] if (cookie) { - request.headers[constants.Header.COOKIE] = cookie + headers[constants.Header.COOKIE] = cookie } else if (apiKey) { - request.headers[constants.Header.API_KEY] = apiKey + if (Array.isArray(apiKey)) { + headers[constants.Header.API_KEY] = apiKey[0] + } else { + headers[constants.Header.API_KEY] = apiKey + } } }