Skip to content

Commit a7a5c5b

Browse files
committed
fix: do not attempt to transform html requests
1 parent 6c3082c commit a7a5c5b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/vite/src/node/server/middlewares/transform.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ export function transformMiddleware(
3232

3333
return async (req, res, next) => {
3434
let url = removeTimestampQuery(req.url!)
35-
if (req.method !== 'GET' || knownIgnoreList.has(req.url!)) {
35+
if (
36+
req.method !== 'GET' ||
37+
req.headers.accept?.includes('text/html') ||
38+
knownIgnoreList.has(req.url!)
39+
) {
3640
return next()
3741
}
3842

0 commit comments

Comments
 (0)