From 18ace7b9066c4492a61db4dbae3b49ad477891b3 Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 29 Mar 2021 12:59:36 -0500 Subject: [PATCH] Don't send permessage-deflate header if not supported (#2993) --- src/node/routes/vscode.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node/routes/vscode.ts b/src/node/routes/vscode.ts index f8cbbd30..aee4cacd 100644 --- a/src/node/routes/vscode.ts +++ b/src/node/routes/vscode.ts @@ -210,7 +210,9 @@ wsRouter.ws("/", ensureAuthenticated, async (req) => { // TODO: Parse this header properly. const extensions = req.headers["sec-websocket-extensions"] const permessageDeflate = extensions ? extensions.includes("permessage-deflate") : false - responseHeaders.push("Sec-WebSocket-Extensions: permessage-deflate; server_max_window_bits=15") + if (permessageDeflate) { + responseHeaders.push("Sec-WebSocket-Extensions: permessage-deflate; server_max_window_bits=15") + } req.ws.write(responseHeaders.join("\r\n") + "\r\n\r\n")