Skip to content

Commit 62ffeae

Browse files
[getsentry/action-github-commit] Auto commit
1 parent 115f34b commit 62ffeae

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/middleware.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ function isAIOrDevTool(userAgent: string): boolean {
5858
* Detects if client wants markdown via Accept header (standards-compliant)
5959
*/
6060
function wantsMarkdownViaAccept(acceptHeader: string): boolean {
61-
return acceptHeader.includes('text/markdown') ||
62-
acceptHeader.includes('text/x-markdown');
61+
return (
62+
acceptHeader.includes('text/markdown') || acceptHeader.includes('text/x-markdown')
63+
);
6364
}
6465

6566
/**
@@ -93,8 +94,11 @@ const handleAIClientRedirect = (request: NextRequest) => {
9394
(clientWantsMarkdown || forceMarkdown) && !url.pathname.endsWith('.md');
9495

9596
// Determine detection method for logging
96-
const detectionMethod = wantsMarkdownViaAccept(acceptHeader) ? 'Accept header' :
97-
isAIOrDevTool(userAgent) ? 'User-agent' : 'Manual';
97+
const detectionMethod = wantsMarkdownViaAccept(acceptHeader)
98+
? 'Accept header'
99+
: isAIOrDevTool(userAgent)
100+
? 'User-agent'
101+
: 'Manual';
98102

99103
// Log user agent for debugging (only for non-static assets)
100104
if (

0 commit comments

Comments
 (0)