From 2d0034fcdfd08e54d326670b199bbad000c54589 Mon Sep 17 00:00:00 2001 From: Aran Reeks <3313791+aran112000@users.noreply.github.com> Date: Tue, 20 Jun 2023 12:00:57 +0100 Subject: [PATCH] When we have custom domain(s), always redirect to them This ensures API Gateway and Cloudfront URLs all redirect to the primary domain - this helps prevent duplicating sites and getting them indexed across multiple hosts accidentally --- src/classes/cloudfrontFunctions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/classes/cloudfrontFunctions.ts b/src/classes/cloudfrontFunctions.ts index d2f6672e..b68f0c89 100644 --- a/src/classes/cloudfrontFunctions.ts +++ b/src/classes/cloudfrontFunctions.ts @@ -1,7 +1,8 @@ import ServerlessError from "../utils/error"; export function redirectToMainDomain(domains: string[] | undefined): string { - if (domains === undefined || domains.length < 2) { + if (domains === undefined) { + // No custom domains specified return ""; }