Skip to content

Commit 1ebe3cc

Browse files
authored
Merge pull request #691 from CodingCatDev/dev
fix(middleware): exclude /auth.md from markdown content rewrite
2 parents 81620f9 + e59300d commit 1ebe3cc

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)