1
0
mirror of synced 2025-12-25 02:17:36 -05:00

prevent 500s when a bogus version like enterprise-server@3.14788585 is attempted

This commit is contained in:
Sarah Schneider
2021-06-16 10:40:00 -04:00
parent d65b9a55ef
commit 0553dd0b66

View File

@@ -17,8 +17,9 @@ module.exports = async function releaseNotesContext (req, res, next) {
const [requestedPlan, requestedRelease] = req.context.currentVersion.split('@')
const releaseNotesPerPlan = req.context.site.data['release-notes'][requestedPlan]
// 404 if no release notes can be found
// 404 if no release notes can be found or the requested release is not supported
if (!releaseNotesPerPlan) return next()
if (!supported.includes(requestedRelease)) return next()
// Release notes handling differs if version has numbered releases (like GHES) or not (like GHAE)
const hasNumberedReleases = !(requestedRelease === 'latest')