| 191 | } |
| 192 | |
| 193 | function isDeprecatedVersion(path) { |
| 194 | // When we rewrote how redirects work, from a lookup model to a |
| 195 | // functional model, the enterprise-server releases that got |
| 196 | // deprecated since then fall between the cracks. Especially |
| 197 | // for custom NextJS page-like pages like /admin/release-notes |
| 198 | // These URLs don't come from any remaining .json lookup file |
| 199 | // and they're not active pages either (e.g. req.context.pages) |
| 200 | const split = path.split('/') |
| 201 | for (const version of deprecatedWithFunctionalRedirects) { |
| 202 | if (split.includes(`enterprise-server@${version}`)) { |
| 203 | return true |
| 204 | } |
| 205 | } |
| 206 | return false |
| 207 | } |