Skip to content

Instantly share code, notes, and snippets.

@wearethefoos
Created April 15, 2019 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wearethefoos/c7921ba6b7e44f46fc76f2d7c0fac9a2 to your computer and use it in GitHub Desktop.
Save wearethefoos/c7921ba6b7e44f46fc76f2d7c0fac9a2 to your computer and use it in GitHub Desktop.
Lambda function to force a specific Host header to be sent to the origin
'use strict';
// force a specific Host header to be sent to the origin
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request;
request.headers.host[0].value = 'jobs.mycompany.com';
return callback(null, request);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment