1
0
mirror of synced 2026-01-10 18:02:53 -05:00

Merge pull request #21508 from github/repo-sync

repo sync
This commit is contained in:
Octomerger Bot
2022-10-20 08:55:28 -07:00
committed by GitHub

View File

@@ -1,12 +1,12 @@
import { languageKeys } from './languages.js'
import nonEnterpriseDefaultVersion from './non-enterprise-default-version.js'
import { allVersions } from './all-versions.js'
import {
latest,
supported,
deprecatedWithFunctionalRedirects,
} from './enterprise-server-releases.js'
import { getPathWithLanguage } from './path-utils.js'
const languagePrefixRegex = new RegExp(`^/(${languageKeys.join('|')})/`)
const nonEnterpriseDefaultVersionPrefix = `/${nonEnterpriseDefaultVersion}`
@@ -33,7 +33,7 @@ export default function getRedirect(uri, context) {
// `redirects` is sourced from more than one thing. The primary use
// case is gathering up the `redirect_from` frontmatter key.
// But we also has `developer.json` which contains legacy redirects.
// But we also have `developer.json` which contains legacy redirects.
// For example, the `developer.json` will have entries such
// `/enterprise/v4/enum/auditlogorderfield` which clearly is using
// the old formatting of the version. So to leverage the redirects
@@ -43,7 +43,7 @@ export default function getRedirect(uri, context) {
if (redirects[withoutLanguage].includes('://')) {
return redirects[withoutLanguage]
}
return `/${language}` + redirects[withoutLanguage]
return getPathWithLanguage(redirects[withoutLanguage], language)
}
let basicCorrection