perf: new ws listener option to disable UTF-8 validation
This commit is contained in:
parent
c93fabb5cc
commit
726302ef6a
|
@ -1104,6 +1104,14 @@ fields("ws_opts") ->
|
|||
sc(
|
||||
ref("deflate_opts"),
|
||||
#{}
|
||||
)},
|
||||
{"validate_utf8",
|
||||
sc(
|
||||
boolean(),
|
||||
#{
|
||||
default => true,
|
||||
desc => ?DESC(fields_ws_opts_validate_utf8)
|
||||
}
|
||||
)}
|
||||
];
|
||||
fields("tcp_opts") ->
|
||||
|
|
|
@ -205,7 +205,8 @@ init(Req, #{listener := {Type, Listener}} = Opts) ->
|
|||
compress => get_ws_opts(Type, Listener, compress),
|
||||
deflate_opts => get_ws_opts(Type, Listener, deflate_opts),
|
||||
max_frame_size => get_ws_opts(Type, Listener, max_frame_size),
|
||||
idle_timeout => get_ws_opts(Type, Listener, idle_timeout)
|
||||
idle_timeout => get_ws_opts(Type, Listener, idle_timeout),
|
||||
validate_utf8 => get_ws_opts(Type, Listener, validate_utf8)
|
||||
},
|
||||
case check_origin_header(Req, Opts) of
|
||||
{error, Reason} ->
|
||||
|
|
|
@ -1275,6 +1275,13 @@ fields_ws_opts_allow_origin_absence.desc:
|
|||
fields_ws_opts_allow_origin_absence.label:
|
||||
"""Allow origin absence"""
|
||||
|
||||
fields_ws_opts_validate_utf8.desc:
|
||||
"""Set to <code>false</code> to disable WebSocket Frame UTF-8
|
||||
validation for performance"""
|
||||
|
||||
fields_ws_opts_validate_utf8.label:
|
||||
"""Enable/Disable WebSocket Frame utf8 validation"""
|
||||
|
||||
common_ssl_opts_schema_versions.desc:
|
||||
"""All TLS/DTLS versions to be supported.<br/>
|
||||
NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.<br/>
|
||||
|
|
Loading…
Reference in New Issue