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

Copy host property from headers to multiValueHeaders #44

Merged
merged 2 commits into from
Oct 1, 2020
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
7 changes: 7 additions & 0 deletions lib/templates/netlifyFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ exports.handler = (event, context, callback) => {
process.env.BINARY_SUPPORT = "yes";
}

// When running on netlify, the header "host" is not set in
// multiValueHeaders so we manually set it here.
// TO-DO: @lindsaylevine/@cassidoo remove after netlify supports internally
if(!event.multiValueHeaders.hasOwnProperty('host')) {
event.multiValueHeaders['host'] = [event.headers['host']]
}

// Get the request URL
const { path } = event;
console.log("[request]", path);
Expand Down