From 097b73c6a544b81591e0f4ee611c78e7f9d03598 Mon Sep 17 00:00:00 2001 From: Blaine Jester Date: Mon, 26 Aug 2024 13:12:12 -0700 Subject: [PATCH] Fix bug with CORS options for an array of one item for `onCall` (#1563) (#1564) Co-authored-by: Daniel Lee --- CHANGELOG.md | 1 + src/v2/providers/https.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11b44ddb9..3e384a131 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ - Fix retry in event triggered functions. (#1463) - Expose retry configuration in v2 RTDB trigger (#1588) +- Fix CORS options for v2 callable functions (#1564) - Remove invalid `enforceAppCheck` option for v2 onRequest trigger (#1477) diff --git a/src/v2/providers/https.ts b/src/v2/providers/https.ts index 37665879d..16ad9038c 100644 --- a/src/v2/providers/https.ts +++ b/src/v2/providers/https.ts @@ -375,7 +375,7 @@ export function onCall>( // on the origin header of the request. If there is only one element in the // array, this is unnecessary. if (Array.isArray(origin) && origin.length === 1) { - origin = origin[1]; + origin = origin[0]; } // onCallHandler sniffs the function length to determine which API to present.