diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gun_http.erl | 12 | ||||
-rw-r--r-- | src/gun_http2.erl | 9 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl index d6b3f0d..7e7bed7 100644 --- a/src/gun_http.erl +++ b/src/gun_http.erl @@ -60,19 +60,19 @@ check_options(Opts) -> do_check_options([]) -> ok; -do_check_options([{keepalive, infinity}|Opts]) -> - do_check_options(Opts); -do_check_options([{keepalive, K}|Opts]) when is_integer(K), K > 0 -> - do_check_options(Opts); -do_check_options([{version, V}|Opts]) when V =:= 'HTTP/1.1'; V =:= 'HTTP/1.0' -> - do_check_options(Opts); do_check_options([Opt={content_handlers, Handlers}|Opts]) -> case gun_content_handler:check_option(Handlers) of ok -> do_check_options(Opts); error -> {error, {options, {http, Opt}}} end; +do_check_options([{keepalive, infinity}|Opts]) -> + do_check_options(Opts); +do_check_options([{keepalive, K}|Opts]) when is_integer(K), K > 0 -> + do_check_options(Opts); do_check_options([{transform_header_name, F}|Opts]) when is_function(F) -> do_check_options(Opts); +do_check_options([{version, V}|Opts]) when V =:= 'HTTP/1.1'; V =:= 'HTTP/1.0' -> + do_check_options(Opts); do_check_options([Opt|_]) -> {error, {options, {http, Opt}}}. diff --git a/src/gun_http2.erl b/src/gun_http2.erl index c48e07e..558dce5 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -80,15 +80,16 @@ check_options(Opts) -> do_check_options([]) -> ok; -do_check_options([{keepalive, infinity}|Opts]) -> - do_check_options(Opts); -do_check_options([{keepalive, K}|Opts]) when is_integer(K), K > 0 -> - do_check_options(Opts); do_check_options([Opt={content_handlers, Handlers}|Opts]) -> case gun_content_handler:check_option(Handlers) of ok -> do_check_options(Opts); error -> {error, {options, {http, Opt}}} end; +do_check_options([{keepalive, infinity}|Opts]) -> + do_check_options(Opts); +do_check_options([{keepalive, K}|Opts]) when is_integer(K), K > 0 -> + do_check_options(Opts); +%% @todo max_frame_size_sent do_check_options([Opt|_]) -> {error, {options, {http2, Opt}}}. |