From 85b6951eb1778240199a2b00dbb0f5ee94e74e4b Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Thu, 20 Oct 2022 17:18:05 +0200 Subject: [PATCH 1/2] cope better with redirects to / (#31903) --- lib/get-redirect.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/get-redirect.js b/lib/get-redirect.js index d26551b710..f4f6e84c07 100644 --- a/lib/get-redirect.js +++ b/lib/get-redirect.js @@ -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 From 9410a39986a9380118b744ec768fa553e4cf0d38 Mon Sep 17 00:00:00 2001 From: Laura Coursen Date: Thu, 20 Oct 2022 10:45:34 -0500 Subject: [PATCH 2/2] Clarify "Configuring IP allow lists for migrations" documentation for GEI (#31902)