Skip to content

Commit 378f2c0

Browse files
authored
Do not check rest for enterprise replacements (#27098)
* do not check rest * update to only check in test * update comment
1 parent 1375656 commit 378f2c0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/get-redirect.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ export default function getRedirect(uri, context) {
184184
// finds one string replacement that yields either a page or a redirect.
185185
function tryReplacements(prefix, suffix, { pages, redirects }) {
186186
const test = (suffix) => {
187+
// This is a generally broad search and replace and this particular
188+
// replacement has never been present in api documentation only enterprise
189+
// admin documentation, so we're excluding the REST api pages
190+
if (suffix.includes('/rest')) {
191+
return false
192+
}
187193
const candidateAsRedirect = prefix + suffix
188194
const candidateAsURL = '/en' + candidateAsRedirect
189195
return candidateAsRedirect in redirects || candidateAsURL in pages

0 commit comments

Comments
 (0)