From 946cd45b3ff2dbd55b8c963e8daf23a149af79e4 Mon Sep 17 00:00:00 2001 From: jvcalderon Date: Fri, 12 May 2023 15:59:42 +0200 Subject: [PATCH] Refactor: BUILDER_REFERER_PREFIX -> BUILDER_APP_PREFIX --- packages/backend-core/src/utils/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend-core/src/utils/utils.ts b/packages/backend-core/src/utils/utils.ts index 1876160829..82da95983a 100644 --- a/packages/backend-core/src/utils/utils.ts +++ b/packages/backend-core/src/utils/utils.ts @@ -18,7 +18,7 @@ const PROD_APP_PREFIX = "/app/" const BUILDER_PREVIEW_PATH = "/app/preview" const BUILDER_PREFIX = "/builder" -const BUILDER_REFERER_PREFIX = `${BUILDER_PREFIX}/app/` +const BUILDER_APP_PREFIX = `${BUILDER_PREFIX}/app/` const PUBLIC_API_PREFIX = "/api/public/v" function confirmAppId(possibleAppId: string | undefined) { @@ -66,7 +66,7 @@ export function isServingApp(ctx: Ctx) { } export function isServingBuilder(ctx: Ctx): boolean { - return ctx.path.startsWith(BUILDER_REFERER_PREFIX) + return ctx.path.startsWith(BUILDER_APP_PREFIX) } export function isServingBuilderPreview(ctx: Ctx): boolean { @@ -118,7 +118,7 @@ export async function getAppIdFromCtx(ctx: Ctx) { // make sure this is performed after prod app url resolution, in case the // referer header is present from a builder redirect const referer = ctx.request.headers.referer - if (!appId && referer?.includes(BUILDER_REFERER_PREFIX)) { + if (!appId && referer?.includes(BUILDER_APP_PREFIX)) { const refererId = parseAppIdFromUrl(ctx.request.headers.referer) appId = confirmAppId(refererId) }