From 6f53f55208497e7701a16280217a3d10f388e9c7 Mon Sep 17 00:00:00 2001 From: cha0s Date: Sun, 12 Jul 2020 19:04:41 -0500 Subject: [PATCH] fix: msg --- src/server/http.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/server/http.js b/src/server/http.js index 6f4c4e1..0a7ad0d 100644 --- a/src/server/http.js +++ b/src/server/http.js @@ -23,13 +23,9 @@ export function createHttpServer() { target: 'http://127.0.0.1:31345', }); proxy.on('error', (err, req, res) => { - if (!(res instanceof ServerResponse)) { - return; + if (res instanceof ServerResponse) { + res.status(502).end('Bad Gateway (WDS)'); } - res.writeHead(500, { - 'Content-Type': 'text/plain', - }); - res.end('Bad Proxy'); }); app.get('*', (req, res) => proxy.web(req, res)); httpServer.on('close', () => proxy.close());