mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
add websocket_compress metadata
This commit is contained in:
parent
3b4c0588e9
commit
83d85e641a
2 changed files with 9 additions and 3 deletions
|
@ -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
|
||||
-------
|
||||
|
||||
|
|
|
@ -121,12 +121,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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue