diff options
author | Loïc Hoguin <[email protected]> | 2019-10-05 17:32:50 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-10-05 17:32:50 +0200 |
commit | 3e23aff1d1b6e4e2f736edd7a8f5465b02c4c6db (patch) | |
tree | aa15ba2ab858e52be86250ddb7637466252e3bda /doc | |
parent | c50d6aa09c9028dca3365516d30f1242cfd43306 (diff) | |
download | cowboy-3e23aff1d1b6e4e2f736edd7a8f5465b02c4c6db.tar.gz cowboy-3e23aff1d1b6e4e2f736edd7a8f5465b02c4c6db.tar.bz2 cowboy-3e23aff1d1b6e4e2f736edd7a8f5465b02c4c6db.zip |
Add Websocket option validate_utf8
This allows disabling the UTF-8 validation check
for text and close frames.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/manual/cowboy_websocket.asciidoc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/doc/src/manual/cowboy_websocket.asciidoc b/doc/src/manual/cowboy_websocket.asciidoc index f8038e5..2f01b8a 100644 --- a/doc/src/manual/cowboy_websocket.asciidoc +++ b/doc/src/manual/cowboy_websocket.asciidoc @@ -151,11 +151,12 @@ Cowboy does it automatically for you. [source,erlang] ---- opts() :: #{ - compress => boolean(), - deflate_opts => cow_ws:deflate_opts() - idle_timeout => timeout(), + compress => boolean(), + deflate_opts => cow_ws:deflate_opts() + idle_timeout => timeout(), max_frame_size => non_neg_integer() | infinity, - req_filter => fun((cowboy_req:req()) -> map()) + req_filter => fun((cowboy_req:req()) -> map()), + validate_utf8 => boolean() } ---- @@ -209,8 +210,21 @@ given back in the `terminate/3` callback. By default it keeps the method, version, URI components and peer information. +validate_utf8 (true):: + +Whether Cowboy should verify that the payload of +`text` and `close` frames is valid UTF-8. This is +required by the protocol specification but in some +cases it may be more interesting to disable it in +order to save resources. ++ +Note that `binary` frames do not have this UTF-8 +requirement and are what should be used under +normal circumstances if necessary. + == Changelog +* *2.7*: The option `validate_utf8` has been added. * *2.6*: Deflate options can now be configured via `deflate_opts`. * *2.0*: The Req object is no longer passed to Websocket callbacks. * *2.0*: The callback `websocket_terminate/3` was removed in favor of `terminate/3`. |