Problem
Draft article files under content/articles/drafts/ can still be resolved by the production article route.
src/routes/(standard)/articles/[...slug]/+page.ts only uses the development guard for the special draft import path. In production, a request like /articles/drafts/svelte falls through to:
post = await import(`$content/articles/${params.slug}.mdx`);
That can resolve content/articles/drafts/svelte.mdx.
Impact
Unpublished draft content can be served publicly in production. The production build also emits draft chunks, confirming inclusion.
Expected
Draft article slugs should 404 in production and draft content should not be included in production output unless explicitly intended.
Suggested Fix
Reject any params.slug containing drafts/ outside development before attempting the generic content import, or exclude drafts from production bundling entirely.
Problem
Draft article files under
content/articles/drafts/can still be resolved by the production article route.src/routes/(standard)/articles/[...slug]/+page.tsonly uses the development guard for the special draft import path. In production, a request like/articles/drafts/sveltefalls through to:That can resolve
content/articles/drafts/svelte.mdx.Impact
Unpublished draft content can be served publicly in production. The production build also emits draft chunks, confirming inclusion.
Expected
Draft article slugs should 404 in production and draft content should not be included in production output unless explicitly intended.
Suggested Fix
Reject any
params.slugcontainingdrafts/outside development before attempting the generic content import, or exclude drafts from production bundling entirely.