Skip to content

Commit

Permalink
fix(server): base middleware redirect with search and hash (#6574)
Browse files Browse the repository at this point in the history
  • Loading branch information
cncolder committed Mar 3, 2022
1 parent c11af23 commit a516e85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/server/middlewares/base.ts
Expand Up @@ -28,9 +28,9 @@ export function baseMiddleware({
}

if (path === '/' || path === '/index.html') {
// redirect root visit to based url
// redirect root visit to based url with search and hash
res.writeHead(302, {
Location: base
Location: base + (parsed.search || '') + (parsed.hash || '')
})
res.end()
return
Expand Down

0 comments on commit a516e85

Please sign in to comment.