From fdfd27afda94b4c879d114806e5b6a8702cfd407 Mon Sep 17 00:00:00 2001 From: Denys Sokolov Date: Wed, 28 Feb 2024 16:10:14 +0100 Subject: [PATCH] CC-32482: Added the protocol map. --- cypress.config.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cypress.config.ts b/cypress.config.ts index ae12e412..b56399ba 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -8,7 +8,13 @@ function getEnvVar(primary: string, fallback: string): string { return process.env[primary] || process.env[fallback]; } -const protocol = getEnvVar('ENV_PROTOCOL', 'SPRYKER_SSL_ENABLE') == '1' ? 'https' : 'http'; +const protocolMap = { + '1': 'https', + '0': 'http', + 'http': 'http', + 'https': 'https', +}; +const protocol = protocolMap[getEnvVar('ENV_PROTOCOL', 'SPRYKER_SSL_ENABLE')]; const backofficeHost = getEnvVar('ENV_BACKOFFICE_HOST', 'SPRYKER_BE_HOST'); const merchantPortalHost = getEnvVar('ENV_MERCHANT_PORTAL_HOST', 'SPRYKER_MP_HOST'); const glueBackendHost = getEnvVar('ENV_GLUE_BACKEND_HOST', 'SPRYKER_GLUE_BACKEND_HOST');