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

Commit 3a59661

Browse files
authored
fix: update cloudfront redirect
1 parent cfe0c41 commit 3a59661

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cdkworkshop.com/cdkworkshop.com.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,12 @@ export class CdkWorkshop extends Stack {
102102
runtime: cloudfront.FunctionRuntime.JS_2_0,
103103
code: cloudfront.FunctionCode.fromInline(`
104104
function handler(event) {
105+
const request = event.request;
105106
const newUri = '${props.redirectTarget}';
106107
return {
107-
status: '302',
108-
statusDescription: 'Found',
109-
headers: {'Location': { value: newUri }},
108+
statusCode: 301,
109+
statusDescription: 'Permanent Redirect',
110+
headers: { location: { value: newUri } },
110111
};
111112
}
112113
`),

0 commit comments

Comments
 (0)