diff --git a/lib/modules/Protocols.pmod/WebSocket.pmod b/lib/modules/Protocols.pmod/WebSocket.pmod
index 4fc5df7c9cb424755a0bccbc1b79efab834d4f53..f05804bcd4750ec8f4fecac47609156141d14a1d 100644
--- a/lib/modules/Protocols.pmod/WebSocket.pmod
+++ b/lib/modules/Protocols.pmod/WebSocket.pmod
@@ -759,7 +759,9 @@ class Request(function(array(string), Request:void) cb) {
     //! handshake. The protocol should be either @expr{0@} or a protocol
     //! advertised by the client when initiating the WebSocket connection.
     //! The returned connection object is in state @[Connection.OPEN].
-    Connection websocket_accept(string protocol) {
+    Connection websocket_accept(string protocol, void|mapping _options) {
+        if (_options)
+            options += _options;
 	string s = request_headers["sec-websocket-key"] + websocket_id;
 	mapping heads = ([
 	    "Upgrade" : "websocket",
@@ -811,7 +813,7 @@ class Request(function(array(string), Request:void) cb) {
             switch (name) {
 #if constant(Gz.deflate)
                 case "permessage-deflate":
-                    if (rext[name])
+                    if (rext[name] || !options->compressionLevel)
                         continue;
                     if (parm->client_no_context_takeover
                      || options->decompressionNoContextTakeover) {