Skip to content

Commit bc4d5ee

Browse files
authored
Update index.js
1 parent 718db13 commit bc4d5ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redirect-based-on-country/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ async function handler(event) {
22
var request = event.request;
33
var headers = request.headers;
44
var host = request.headers.host.value;
5-
var country = Symbol.for('DE'); // Choose a country code
5+
var country = 'DE' // Choose a country code
66
var newurl = `https://${host}/de/index.html`; // Change the redirect URL to your choice
77

88
if (headers['cloudfront-viewer-country']) {
9-
var countryCode = Symbol.for(headers['cloudfront-viewer-country'].value);
9+
var countryCode = headers['cloudfront-viewer-country'].value;
1010
if (countryCode === country) {
1111
var response = {
1212
statusCode: 302,

0 commit comments

Comments
 (0)