Skip to content

Commit

Permalink
fix: do not attempt to transform html requests
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 2, 2021
1 parent 6c3082c commit a7a5c5b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/node/server/middlewares/transform.ts
Expand Up @@ -32,7 +32,11 @@ export function transformMiddleware(

return async (req, res, next) => {
let url = removeTimestampQuery(req.url!)
if (req.method !== 'GET' || knownIgnoreList.has(req.url!)) {
if (
req.method !== 'GET' ||
req.headers.accept?.includes('text/html') ||
knownIgnoreList.has(req.url!)
) {
return next()
}

Expand Down

0 comments on commit a7a5c5b

Please sign in to comment.