From 5e41ff1d22948f5247a42688824034cf7519d7db Mon Sep 17 00:00:00 2001 From: Kevin Heis Date: Tue, 5 Nov 2024 13:37:23 -0800 Subject: [PATCH] Fix for prod assets --- src/archives/middleware/archived-enterprise-versions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/archives/middleware/archived-enterprise-versions.ts b/src/archives/middleware/archived-enterprise-versions.ts index cbe4aa5728..50e241e575 100644 --- a/src/archives/middleware/archived-enterprise-versions.ts +++ b/src/archives/middleware/archived-enterprise-versions.ts @@ -33,6 +33,8 @@ const OLD_DEVELOPER_SITE_CONTAINER = `${OLD_PUBLIC_AZURE_BLOB_URL}/developer-sit // version. E.g. https://github.github.com/docs-ghes-2.10 const ENTERPRISE_GH_PAGES_URL_PREFIX = 'https://github.github.com/docs-ghes-' +const inProd = process.env.NODE_ENV === 'production' // temporary + type ArchivedRedirects = { [url: string]: string | null } @@ -234,7 +236,7 @@ export default async function archivedEnterpriseVersions( ) .replaceAll( `${OLD_AZURE_BLOB_ENTERPRISE_DIR}/${requestedVersion}/`, - `${req.protocol}://${req.get('host')}/enterprise-server@${requestedVersion}/`, + `${req.protocol}://${inProd ? 'docs.github.com' : req.get('host')}/enterprise-server@${requestedVersion}/`, ) }