Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/event-sources/azure/http-function-runtime-v3.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ function getResponseToHttpFunction ({ statusCode, body, headers = {}, isBase64En
}

const cookies = []
const headerCookies = headers['set-cookie']

// headers['set-cookie'] can be a string of one cookie, or an array of cookies
// headerCookies should always be an array
const headerCookies = [].concat(headers['set-cookie'] || [])

// Convert 'set-cookie' to Azure Function 3.x cookie object array
// https://github.com/Azure/azure-functions-nodejs-worker/blob/v3.x/types/index.d.ts#L150
if (headerCookies) {
if (headerCookies.length > 0) {
for (const headerCookie of headerCookies) {
const parsedCookie = parseCookie(headerCookie)
const nameValueTuple = headerCookie.split(';')[0].split('=')
Expand Down