Last active
March 2, 2021 07:49
-
-
Save vipin87/f0532a9b416b6fd8f3b5eef71c1024ff to your computer and use it in GitHub Desktop.
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'; | |
exports.handler = (event, context, callback) => { | |
console.log(JSON.stringify(event.Records[0].cf)); | |
var request = event.Records[0].cf.request | |
var host = request.headers.host[0].value; | |
var uri = request.uri; | |
request.uri = '/' + host + uri; | |
console.log('new uri', request.uri) | |
// Return to CloudFront | |
return callback(null, request); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment