Skip to content

Commit

Permalink
fix: don't call next middleware if user sent response in proxy.bypass (
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Feb 3, 2025
1 parent e976585 commit 7e6364d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vite/src/node/server/middlewares/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ export function proxyMiddleware(
if (typeof bypassResult === 'string') {
debug?.(`bypass: ${req.url} -> ${bypassResult}`)
req.url = bypassResult
if (res.writableEnded) {
return
}
return next()
}
if (bypassResult === false) {
Expand Down

0 comments on commit 7e6364d

Please sign in to comment.