Skip to content

Commit e59300d

Browse files
committed
fix(middleware): exclude /auth.md from markdown content rewrite
1 parent 484634f commit e59300d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/site/src/middleware.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ export const onRequest = defineMiddleware(async (context, next) => {
3333

3434
const origin = context.locals.siteUrl.origin;
3535
const pathname = context.url.pathname;
36+
const isDedicatedMarkdownEndpoint = pathname === "/auth.md";
3637
const isMarkdownUrl =
37-
pathname.endsWith(".md") || pathname.endsWith("/index.md");
38+
!isDedicatedMarkdownEndpoint &&
39+
(pathname.endsWith(".md") || pathname.endsWith("/index.md"));
3840
const acceptMarkdown = context.request.headers
3941
.get("Accept")
4042
?.includes("text/markdown");

0 commit comments

Comments
 (0)