diff options
author | Steve Domin <[email protected]> | 2018-02-17 16:43:46 +0300 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-10-31 17:05:11 +0100 |
commit | 09bf1199aa3e33a73970ee4ce38714be087b0df0 (patch) | |
tree | 8e75b6cf00a8a57f9446563bfe7455415b3655dd /src/cowboy_http.erl | |
parent | 30e117a9420b21a94d185a27f174d0991e38077d (diff) | |
download | cowboy-09bf1199aa3e33a73970ee4ce38714be087b0df0.tar.gz cowboy-09bf1199aa3e33a73970ee4ce38714be087b0df0.tar.bz2 cowboy-09bf1199aa3e33a73970ee4ce38714be087b0df0.zip |
Add compress_threshold protocol option
Currently the compression threshold is set to 300 and hardcoded in the
codebase. There are cases where it make sense to allow this to be
configured, for instance when you want to enforce all responses to be
compressed regarldess of their size.
Diffstat (limited to 'src/cowboy_http.erl')
-rw-r--r-- | src/cowboy_http.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl index 340ced7..91a539f 100644 --- a/src/cowboy_http.erl +++ b/src/cowboy_http.erl @@ -25,6 +25,7 @@ -export([system_code_change/4]). -type opts() :: #{ + compress_threshold => non_neg_integer(), connection_type => worker | supervisor, env => cowboy_middleware:env(), idle_timeout => timeout(), @@ -46,7 +47,9 @@ shutdown_timeout => timeout(), stream_handlers => [module()], tracer_callback => cowboy_tracer_h:tracer_callback(), - tracer_match_specs => cowboy_tracer_h:tracer_match_specs() + tracer_match_specs => cowboy_tracer_h:tracer_match_specs(), + %% Open ended because configured stream handlers might add options. + _ => _ }. -export_type([opts/0]). |