Skip to content

Commit

Permalink
chore: use constant for KeyCDN suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
dcshzj committed May 14, 2024
1 parent d33c2d0 commit 3ea7d34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export const REDIRECTION_SERVER_IPS = [
"18.139.47.66",
]
export const DNS_INDIRECTION_DOMAIN = "hostedon.isomer.gov.sg"
export const DNS_CNAME_SUFFIXES = ["cloudfront.net", "kxcdn.com"]
export const DNS_KEYCDN_SUFFIX = "kxcdn.com"
export const DNS_CNAME_SUFFIXES = ["cloudfront.net", DNS_KEYCDN_SUFFIX]
export const DNS_INDIRECTION_REPO = "isomer-indirection"
export const ISOMER_ADMIN_EMAIL = "[email protected]"
export const ISOMER_SUPPORT_EMAIL = "[email protected]"
Expand Down
3 changes: 2 additions & 1 deletion support/routes/v2/isobot/ops/botService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { config } from "@config/config"
import {
DNS_CNAME_SUFFIXES,
DNS_INDIRECTION_DOMAIN,
DNS_KEYCDN_SUFFIX,
REDIRECTION_SERVER_IPS,
} from "@root/constants"
import logger from "@root/logger/logger"
Expand Down Expand Up @@ -206,7 +207,7 @@ class BotService {
const isIntermediateValid =
intermediateRecords &&
((cnameRecord &&
cnameRecord.endsWith(".kxcdn.com") &&
cnameRecord.endsWith(`.${DNS_KEYCDN_SUFFIX}`) &&
intermediateRecords.length === 1) ||
(intermediateRecords.length === 4 &&
(isDomainCnameCorrect ||
Expand Down

0 comments on commit 3ea7d34

Please sign in to comment.