aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-08-27 18:10:51 +0200
committerLoïc Hoguin <[email protected]>2013-08-27 18:10:51 +0200
commitb22f25d902a2c74a61f75270dbb96d5ce15b4f60 (patch)
tree2806cc7f56f7ee12c47f904bcc700d626af754b3
parentfe7cc08daff4a9bb8d6a4dd161b53e7d6ce6ab4c (diff)
parent83d85e641aa1dbbb155299226c09c4ea92b8be3a (diff)
downloadcowboy-b22f25d902a2c74a61f75270dbb96d5ce15b4f60.tar.gz
cowboy-b22f25d902a2c74a61f75270dbb96d5ce15b4f60.tar.bz2
cowboy-b22f25d902a2c74a61f75270dbb96d5ce15b4f60.zip
Merge branch 'websocket-compressed-metadata' of git://github.com/irccloud/cowboy
-rw-r--r--manual/cowboy_websocket.md6
-rw-r--r--src/cowboy_websocket.erl6
2 files changed, 9 insertions, 3 deletions
diff --git a/manual/cowboy_websocket.md b/manual/cowboy_websocket.md
index ae3ca1b..1b07107 100644
--- a/manual/cowboy_websocket.md
+++ b/manual/cowboy_websocket.md
@@ -28,6 +28,12 @@ Meta values
>
> The version of the Websocket protocol being used.
+### websocket_compress
+
+> Type: true | false
+>
+> Whether a websocket compression extension in in use.
+
Exports
-------
diff --git a/src/cowboy_websocket.erl b/src/cowboy_websocket.erl
index 88afbd0..50d5b9b 100644
--- a/src/cowboy_websocket.erl
+++ b/src/cowboy_websocket.erl
@@ -123,12 +123,12 @@ websocket_extensions(State, Req) ->
deflate_frame = true,
inflate_state = Inflate,
deflate_state = Deflate
- }, Req2};
+ }, cowboy_req:set_meta(websocket_compress, true, Req2)};
_ ->
- {ok, State, Req2}
+ {ok, State, cowboy_req:set_meta(websocket_compress, false, Req2)}
end;
_ ->
- {ok, State, Req}
+ {ok, State, cowboy_req:set_meta(websocket_compress, false, Req)}
end.
-spec handler_init(#state{}, Req, any())