From 125bbe644174b9c3c77a9b2649810f837b98c311 Mon Sep 17 00:00:00 2001 From: nai-degen Date: Fri, 4 Aug 2023 13:49:11 -0500 Subject: [PATCH] fixes issue with writeErrorResponse --- src/proxy/middleware/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proxy/middleware/common.ts b/src/proxy/middleware/common.ts index d4266ef..78020cd 100644 --- a/src/proxy/middleware/common.ts +++ b/src/proxy/middleware/common.ts @@ -21,7 +21,7 @@ export function writeErrorResponse( statusCode: number, errorPayload: Record ) { - const errorSource = errorPayload.error?.type.startsWith("proxy") + const errorSource = errorPayload.error?.type?.startsWith("proxy") ? "proxy" : "upstream";