mirror of
https://github.com/coder/code-server.git
synced 2024-12-25 18:52:34 +03:00
Don't send permessage-deflate header if not supported (#2993)
This commit is contained in:
parent
6cf904a39b
commit
18ace7b906
@ -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")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user