We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6f3b02 commit d2f02a8Copy full SHA for d2f02a8
1 file changed
packages/vite/src/node/server/middlewares/proxy.ts
@@ -55,11 +55,13 @@ export function proxyMiddleware(
55
error: err
56
}
57
)
58
- res
59
- .writeHead(500, {
60
- 'Content-Type': 'text/plain'
61
- })
62
- .end()
+ if (!res.writableEnded) {
+ res
+ .writeHead(500, {
+ 'Content-Type': 'text/plain'
+ })
63
+ .end()
64
+ }
65
} else {
66
config.logger.error(`${colors.red(`ws proxy error:`)}\n${err.stack}`, {
67
timestamp: true,
0 commit comments