From 0e6e94eff8608b09033624da4dfc6a22885632d8 Mon Sep 17 00:00:00 2001 From: Cole Diffin <2082764+arcticShadow@users.noreply.github.com> Date: Wed, 8 Mar 2023 19:37:45 +1300 Subject: [PATCH] feat: include request headers from both multi value and single value proxy response (#272) --- lib/provider/aws/create-request.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/provider/aws/create-request.js b/lib/provider/aws/create-request.js index cbe6293..f2f76c5 100644 --- a/lib/provider/aws/create-request.js +++ b/lib/provider/aws/create-request.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; const URL = require('url'); @@ -19,13 +19,14 @@ function requestRemoteAddress(event) { } function requestHeaders(event) { - const initialHeader = event.version === '2.0' && Array.isArray(event.cookies) - ? { cookie: event.cookies.join('; ') } - : {}; + const initialHeader = + event.version === '2.0' && Array.isArray(event.cookies) + ? { cookie: event.cookies.join('; ') } + : {}; if (event.multiValueHeaders) { - return Object.keys(event.multiValueHeaders).reduce((headers, key) => { - headers[key.toLowerCase()] = event.multiValueHeaders[key].join(", ") + Object.keys(event.multiValueHeaders).reduce((headers, key) => { + headers[key.toLowerCase()] = event.multiValueHeaders[key].join(', '); return headers; }, initialHeader); }