diff --git a/src/modules/frontend/createContentHelpers.ts b/src/modules/frontend/createContentHelpers.ts index 8800809..f70aaa4 100644 --- a/src/modules/frontend/createContentHelpers.ts +++ b/src/modules/frontend/createContentHelpers.ts @@ -15,7 +15,7 @@ import type { PageMetadata, RobotsOptions, RobotsRules, SitemapEntry, SitemapRou import { getAnalyticsConfig } from '../analytics/getAnalyticsConfig.js' import { getConsentTexts } from '../consent/getConsentTexts.js' -import { normalizePath } from '../construction/logic.js' +import { isPathAllowed } from '../construction/logic.js' import { pathOf } from '../construction/visibility.js' import { createMarkdownRoute } from '../content/createMarkdownRenderer.js' import { getArchiveEntries, resolveRoute as resolveRouteRaw } from '../content/index.js' @@ -457,9 +457,10 @@ export function createContentHelpers({ }) // Under construction: list only the pages visitors can still open — the // rest redirect to the homepage notice, which crawlers would index. + // Same check as isPathVisibleIn(mode, pathOf(url)) (security-perf branch), with the + // mode read once for the whole list. const open = await constructionPaths() - const allowed = open ? new Set(open.map(normalizePath)) : null - const visible = allowed ? entries.filter((e) => allowed.has(normalizePath(pathOf(e.url)))) : entries + const visible = open ? entries.filter((e) => isPathAllowed(pathOf(e.url), open)) : entries return transformSitemap ? await transformSitemap(visible) : visible } catch (error) { // At runtime a failure is an error (the sitemap route answers 503, so