Skip to content

Commit fd06077

Browse files
authored
Merge pull request #82 from puzza007/update-cowboy
Update cowlib/cowboy to 2.2.0
2 parents c6badf9 + c04e091 commit fd06077

File tree

5 files changed

+16
-30
lines changed

5 files changed

+16
-30
lines changed

rebar.config

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{minimum_otp_vsn, "19.1"}.
66

77
{deps, [
8-
{cowlib, "1.0.2"},
8+
{cowlib, "2.4.0"},
99
{worker_pool, "3.1.1"},
1010
{metrics, "2.5.0"}
1111
]}.
@@ -16,7 +16,7 @@
1616
[{deps,
1717
[{jsx, "2.9.0"},
1818
{meck, "0.8.10"},
19-
{cowboy, "1.0.0"},
19+
{cowboy, "2.4.0"},
2020
{http_proxy, ".*", {git, "https://github.com/puzza007/http_proxy.git", {branch, "rebar3"}}}
2121
]}]
2222
}]
@@ -40,7 +40,7 @@
4040
deprecated_functions]}.
4141

4242
{plugins, [rebar3_hex,
43-
{coveralls, {git, "https://github.com/markusn/coveralls-erl", {ref, "57a190502cd2606d2b5cc142bd5cec1ec7c497b2"}}}]}.
43+
{coveralls, "1.4.0"}]}.
4444
{cover_enabled, true}.
4545
{cover_export_enabled, true}.
4646
{coveralls_coverdata, "_build/test/cover/ct.coverdata"}.

rebar.lock

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
{"1.1.0",
2-
[{<<"cowlib">>,{pkg,<<"cowlib">>,<<"1.0.2">>},0},
3-
{<<"metrics">>,
4-
{git,"https://github.com/voughtdq/erlang-metrics.git",
5-
{ref,"cc99b5be6afcd6bd3715fa23ed9ffd207cfb5996"}},
6-
0},
2+
[{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.4.0">>},0},
3+
{<<"metrics">>,{pkg,<<"metrics">>,<<"2.5.0">>},0},
74
{<<"worker_pool">>,{pkg,<<"worker_pool">>,<<"3.1.1">>},0}]}.
85
[
96
{pkg_hash,[
10-
{<<"cowlib">>, <<"9D769A1D062C9C3AC753096F868CA121E2730B9A377DE23DEC0F7E08B1DF84EE">>},
7+
{<<"cowlib">>, <<"93525F288EBAD37A9DFDDD1CCED54A7BFDC96B8DDF66BE1927447048DE65DA8E">>},
8+
{<<"metrics">>, <<"268D218D56529CB5F070D74BBFC3AF64C668379B5B18FAFDA88959442F790C57">>},
119
{<<"worker_pool">>, <<"A9BF27CFF366999784A3F0657F016CE3A57901490858CCA3FB3BE1208BF2110D">>}]}
1210
].

src/katipo.erl

-4
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,13 @@
207207
-type body() :: binary().
208208
-type request() :: map().
209209
-type metrics() :: proplists:proplist().
210-
-ifdef(OTP_RELEASE).
211210
-type response() :: {ok, #{status := status(),
212211
headers := headers(),
213212
cookiejar := cookiejar(),
214213
body := body(),
215214
metrics => proplists:proplist()}} |
216215
{error, #{code := error_code(),
217216
message := error_msg()}}.
218-
-else.
219-
-type response() :: {ok, map()} | {error, map()}.
220-
-endif.
221217
-type http_auth() :: basic | digest.
222218
-type http_auth_int() :: ?CURLAUTH_UNDEFINED | ?CURLAUTH_BASIC | ?CURLAUTH_DIGEST.
223219
-type curlmopts() :: [{max_pipeline_length, non_neg_integer()} |

test/get_handler.erl

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
-module(get_handler).
22

3-
-export([init/3]).
4-
-export([handle/2]).
5-
-export([terminate/3]).
3+
-export([init/2]).
64

7-
init(_, Req, _) ->
8-
{ok, Req, no_state}.
9-
10-
handle(Req, State) ->
5+
init(Req, Opts) ->
116
Req2 = cowboy_req:reply(200, Req),
12-
{ok, Req2, State}.
13-
14-
terminate(_, _, _) ->
15-
ok.
7+
{ok, Req2, Opts}.

test/katipo_SUITE.erl

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ init_per_group(https, Config) ->
3030
Dispatch = cowboy_router:compile([{'_', [{"/", get_handler, []}]}]),
3131
DataDir = ?config(data_dir, Config),
3232
CACert = filename:join(DataDir, "cowboy-ca.crt"),
33-
{ok, _} = cowboy:start_https(ct_https, 1,
34-
[{port, 8443},
35-
{cacertfile, CACert},
36-
{certfile, filename:join(DataDir, "server.crt")},
37-
{keyfile, filename:join(DataDir, "server.key")}],
38-
[{env, [{dispatch, Dispatch}]}]),
33+
{ok, _} = cowboy:start_tls(ct_https,
34+
[{port, 8443},
35+
{cacertfile, CACert},
36+
{certfile, filename:join(DataDir, "server.crt")},
37+
{keyfile, filename:join(DataDir, "server.key")}],
38+
#{env => #{dispatch => Dispatch}}),
3939
[{cacert_file, list_to_binary(CACert)} | Config];
4040
init_per_group(proxy, Config) ->
4141
application:ensure_all_started(http_proxy),

0 commit comments

Comments
 (0)