From 826d507af11448021155f9e63a9a19bbcba6d042 Mon Sep 17 00:00:00 2001 From: Blaine Jester Date: Sun, 5 May 2024 05:36:31 -0700 Subject: [PATCH] Fix bug with CORS options for an array of one item for `onCall` (#1563) --- 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 e69de29bb..d9f82ae81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1 @@ +Fix bug with CORS options for an array of one item for `onCall` (#1563) diff --git a/src/v2/providers/https.ts b/src/v2/providers/https.ts index 311323f46..f322a0f41 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.