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.
|
// TODO: Parse this header properly.
|
||||||
const extensions = req.headers["sec-websocket-extensions"]
|
const extensions = req.headers["sec-websocket-extensions"]
|
||||||
const permessageDeflate = extensions ? extensions.includes("permessage-deflate") : false
|
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")
|
req.ws.write(responseHeaders.join("\r\n") + "\r\n\r\n")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user