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

Commit 97cbdaf

Browse files
Merge pull request #44 from lindsaylevine/host-header-prop
Copy host property from headers to multiValueHeaders
2 parents 1f1373e + 07f6f29 commit 97cbdaf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/templates/netlifyFunction.js

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

34+
// When running on netlify, the header "host" is not set in
35+
// multiValueHeaders so we manually set it here.
36+
// TO-DO: @lindsaylevine/@cassidoo remove after netlify supports internally
37+
if(!event.multiValueHeaders.hasOwnProperty('host')) {
38+
event.multiValueHeaders['host'] = [event.headers['host']]
39+
}
40+
3441
// Get the request URL
3542
const { path } = event;
3643
console.log("[request]", path);

0 commit comments

Comments
 (0)