Created
April 15, 2019 11:32
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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