From 8dc541a321e9c09e19a1766615642c972fd38fc8 Mon Sep 17 00:00:00 2001 From: Diana Catalina Olarte Date: Tue, 20 Aug 2024 13:53:49 +1000 Subject: [PATCH] refactor: parse PUBLIC_PATH for CDN support --- src/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.js b/src/config.js index 2e345c8eb..afcf2cc70 100644 --- a/src/config.js +++ b/src/config.js @@ -126,7 +126,7 @@ import { APP_CONFIG_INITIALIZED, CONFIG_CHANGED } from './constants'; import { publish, subscribe } from './pubSub'; -import { ensureDefinedConfig } from './utils'; +import { ensureDefinedConfig, getPath } from './utils'; function extractRegex(envVar) { // Convert the environment variable string to a regex, while guarding @@ -143,7 +143,7 @@ let config = { ACCOUNT_PROFILE_URL: process.env.ACCOUNT_PROFILE_URL, ACCOUNT_SETTINGS_URL: process.env.ACCOUNT_SETTINGS_URL, BASE_URL: process.env.BASE_URL, - PUBLIC_PATH: process.env.PUBLIC_PATH || '/', + PUBLIC_PATH: getPath(process.env.PUBLIC_PATH) || '/', CREDENTIALS_BASE_URL: process.env.CREDENTIALS_BASE_URL, CSRF_TOKEN_API_PATH: process.env.CSRF_TOKEN_API_PATH, DISCOVERY_API_BASE_URL: process.env.DISCOVERY_API_BASE_URL,