Skip to content

Commit

Permalink
Work for preview envs
Browse files Browse the repository at this point in the history
  • Loading branch information
heiskr committed Nov 5, 2024
1 parent e18e159 commit 7c850c9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/archives/middleware/archived-enterprise-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ 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
}
Expand Down Expand Up @@ -236,7 +234,7 @@ export default async function archivedEnterpriseVersions(
)
.replaceAll(
`${OLD_AZURE_BLOB_ENTERPRISE_DIR}/${requestedVersion}/`,
`${req.protocol}://${inProd ? 'docs.github.com' : req.get('host')}/enterprise-server@${requestedVersion}/`,
`${req.protocol}://${req.get('x-forwarded-host') || req.get('host')}/enterprise-server@${requestedVersion}/`,
)
}

Expand Down

0 comments on commit 7c850c9

Please sign in to comment.