mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Websocket: Also apply max_frame_size limit to decompressed data
Before this commit frames could "cheat" by compressing data below the limit which would get expanded above the limit. Now Cowboy will stop decompressing data when the limit is reached.
This commit is contained in:
parent
6e221d38b1
commit
7f739cad6d
3 changed files with 26 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
|||
-export([websocket_info/2]).
|
||||
|
||||
init(Req, State) ->
|
||||
{cowboy_websocket, Req, State, #{max_frame_size => 8}}.
|
||||
{cowboy_websocket, Req, State, #{max_frame_size => 8, compress => true}}.
|
||||
|
||||
websocket_handle({text, Data}, State) ->
|
||||
{[{text, Data}], State};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue