From 1c19641280aa171ebcaafdc7599b37aa3950d3cc Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Tue, 13 Oct 2026 17:20:18 +0200 Subject: [PATCH] style(html-view): prettier-clean the resolved-path dot check Co-Authored-By: Claude Opus 5.5 (1M context) --- src/web/routes/html-view-routes.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/web/routes/html-view-routes.ts b/src/web/routes/html-view-routes.ts index 6fa90df3..19b89639 100644 --- a/src/web/routes/html-view-routes.ts +++ b/src/web/routes/html-view-routes.ts @@ -239,7 +239,8 @@ export function registerHtmlViewRoutes(app: FastifyInstance, ctx: SessionPort): // dot and extension rules have to hold for where a link LANDS as well: a // `cfg.json -> .git/config` inside the page's folder passes both on its own name. if (!isUnderTree(resolvedPath, record.rootDir)) return notFound(); - if (relative(record.rootDir, resolvedPath).split(sep).some((s) => s.startsWith('.'))) return notFound(); + const landed = relative(record.rootDir, resolvedPath).split(sep); + if (landed.some((s) => s.startsWith('.'))) return notFound(); // Typed by what the bytes are, the resolved name. const contentType = ASSET_TYPES[extensionOf(resolvedPath)]; if (!contentType) return notFound();