diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb..b8b38eeab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1 @@ +Fix bug with CORS options for an array of one string (#1544) diff --git a/src/v2/providers/https.ts b/src/v2/providers/https.ts index 54eee861e..311323f46 100644 --- a/src/v2/providers/https.ts +++ b/src/v2/providers/https.ts @@ -269,7 +269,7 @@ export function onRequest( // 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]; } const middleware = cors({ origin });