Skip to content

Commit 826d507

Browse files
committed
Fix bug with CORS options for an array of one item for onCall (firebase#1563)
1 parent 9c81871 commit 826d507

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug with CORS options for an array of one item for `onCall` (#1563)

src/v2/providers/https.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ export function onCall<T = any, Return = any | Promise<any>>(
375375
// on the origin header of the request. If there is only one element in the
376376
// array, this is unnecessary.
377377
if (Array.isArray(origin) && origin.length === 1) {
378-
origin = origin[1];
378+
origin = origin[0];
379379
}
380380

381381
// onCallHandler sniffs the function length to determine which API to present.

0 commit comments

Comments
 (0)