Skip to content

Commit

Permalink
fix: return 500 on proxy error only if possible (fixes #9172) (#9193)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Jul 18, 2022
1 parent 99b0e67 commit b2f6bdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/middlewares/proxy.ts
Expand Up @@ -55,7 +55,7 @@ export function proxyMiddleware(
error: err
}
)
if (!res.writableEnded) {
if (!res.headersSent && !res.writableEnded) {
res
.writeHead(500, {
'Content-Type': 'text/plain'
Expand Down

0 comments on commit b2f6bdc

Please sign in to comment.