Skip to content

Commit

Permalink
feat: include request headers from both multi value and single value …
Browse files Browse the repository at this point in the history
…proxy response (#272)
  • Loading branch information
arcticShadow committed Mar 8, 2023
1 parent 81c3505 commit 0e6e94e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/provider/aws/create-request.js
@@ -1,4 +1,4 @@
"use strict";
'use strict';

const URL = require('url');

Expand All @@ -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);
}
Expand Down

0 comments on commit 0e6e94e

Please sign in to comment.