Skip to content

Commit 097b73c

Browse files
bjestertaeold
andauthored
Fix bug with CORS options for an array of one item for onCall (#1563) (#1564)
Co-authored-by: Daniel Lee <[email protected]>
1 parent e0f786f commit 097b73c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
- Fix retry in event triggered functions. (#1463)
22
- Expose retry configuration in v2 RTDB trigger (#1588)
3+
- Fix CORS options for v2 callable functions (#1564)
34
- Remove invalid `enforceAppCheck` option for v2 onRequest trigger (#1477)

src/v2/providers/https.ts

+1-1
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)