Skip to content
This repository was archived by the owner on May 10, 2021. It is now read-only.

Commit c41afe5

Browse files
leomeneguzziLindsay Levine
authored andcommitted
Copy host property from headers to multiValueHeaders
1 parent 1f1373e commit c41afe5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/templates/netlifyFunction.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ exports.handler = (event, context, callback) => {
3131
process.env.BINARY_SUPPORT = "yes";
3232
}
3333

34+
// When running at the netlify, the header "host" is not set in
35+
// multiValueHeaders. So we manually set this property.
36+
if(!event.multiValueHeaders.hasOwnProperty('host')) {
37+
event.multiValueHeaders['host'] = [event.headers['host']]
38+
}
39+
3440
// Get the request URL
3541
const { path } = event;
3642
console.log("[request]", path);

0 commit comments

Comments
 (0)