Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
fix: update cloudfront redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
kellertk committed Aug 1, 2024
1 parent cfe0c41 commit 3a59661
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cdkworkshop.com/cdkworkshop.com.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,12 @@ export class CdkWorkshop extends Stack {
runtime: cloudfront.FunctionRuntime.JS_2_0,
code: cloudfront.FunctionCode.fromInline(`
function handler(event) {
const request = event.request;
const newUri = '${props.redirectTarget}';
return {
status: '302',
statusDescription: 'Found',
headers: {'Location': { value: newUri }},
statusCode: 301,
statusDescription: 'Permanent Redirect',
headers: { location: { value: newUri } },
};
}
`),
Expand Down

0 comments on commit 3a59661

Please sign in to comment.