Skip to content

Commit

Permalink
fix: htmlFallbackMiddleware for favicon (#15301)
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev authored Dec 12, 2023
1 parent 7b71854 commit c902545
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vite/src/node/server/middlewares/htmlFallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export function htmlFallbackMiddleware(
if (
// Only accept GET or HEAD
(req.method !== 'GET' && req.method !== 'HEAD') ||
// Exclude default favicon requests
req.url === '/favicon.ico' ||
// Require Accept: text/html or */*
!(
req.headers.accept === undefined || // equivalent to `Accept: */*`
Expand Down

0 comments on commit c902545

Please sign in to comment.