aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-06-03 08:02:37 +0200
committerLoïc Hoguin <[email protected]>2018-06-03 08:02:37 +0200
commit6233bdbb712b857680c6ccfab6b2692c1e15514e (patch)
tree33435fab744317008888e0db40446f8f197e40d1
parent2e68b70cb721d85ea71761cf62dc47d627844226 (diff)
downloadgun-6233bdbb712b857680c6ccfab6b2692c1e15514e.tar.gz
gun-6233bdbb712b857680c6ccfab6b2692c1e15514e.tar.bz2
gun-6233bdbb712b857680c6ccfab6b2692c1e15514e.zip
Reorder the option checks
-rw-r--r--src/gun_http.erl12
-rw-r--r--src/gun_http2.erl9
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}}}.