diff --git a/lib/templates/netlifyFunction.js b/lib/templates/netlifyFunction.js index 15a7da8..f639ed3 100644 --- a/lib/templates/netlifyFunction.js +++ b/lib/templates/netlifyFunction.js @@ -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);