diff --git a/example/README.md b/example/README.md index 9be6794..ee56dc4 100644 --- a/example/README.md +++ b/example/README.md @@ -31,7 +31,7 @@ $ curl -i http://localhost:8080/description desc => "Sets an env var in the server"}}, options => [],path_match => "/poor-kv/:key/[:value]"}, #{constraints => [],handler => example_description_handler, - metadata => #{get => #{desc => "Retrives trails's server description"}}, + metadata => #{get => #{desc => "Retrieves trails's server description"}}, options => [],path_match => <<"/description">>}] ``` diff --git a/example/src/example.erl b/example/src/example.erl index e6d52bc..ce23dda 100644 --- a/example/src/example.erl +++ b/example/src/example.erl @@ -37,7 +37,7 @@ start_phase(start_trails_http, _StartType, []) -> trails:trail(<<"/description">>, example_description_handler, [], - #{get => #{desc => "Retrives trails's server description"}}), + #{get => #{desc => "Retrieves trails's server description"}}), Handlers = [example_poor_kv_handler], Trails = trails:trails(Handlers) ++ [DescriptionTrail], trails:store(Trails), diff --git a/src/trails.erl b/src/trails.erl index 0930ac8..cb55628 100644 --- a/src/trails.erl +++ b/src/trails.erl @@ -270,8 +270,8 @@ host_matches(ServerRef) -> lists:flatten( ets:match(ranch_server, {{proto_opts, ServerRef}, '$1'})), Env = maps:get(env, Opts, #{}), - Dispatchs = maps:get(dispatch, Env, []), - lists:flatten([Host || {Host, _, _} <- Dispatchs]). + Dispatches = maps:get(dispatch, Env, []), + lists:flatten([Host || {Host, _, _} <- Dispatches]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Private API. diff --git a/test/trails_SUITE.erl b/test/trails_SUITE.erl index 418705c..c35904c 100644 --- a/test/trails_SUITE.erl +++ b/test/trails_SUITE.erl @@ -81,9 +81,9 @@ end_per_testcase(_, Config) -> -spec minimal_compile_test(config()) -> {atom(), string()}. minimal_compile_test(_Config) -> - MininalRoute = [{'_', []}], - ExpectedResponse = cowboy_router:compile(MininalRoute), - ExpectedResponse = trails:compile(MininalRoute), + MinimalRoute = [{'_', []}], + ExpectedResponse = cowboy_router:compile(MinimalRoute), + ExpectedResponse = trails:compile(MinimalRoute), {comment, ""}. -spec empty_compile_test(config()) -> {atom(), string()}. @@ -109,10 +109,10 @@ static_compile_test(_Config) -> -spec minimal_single_host_compile_test(config()) -> {atom(), string()}. minimal_single_host_compile_test(_Config) -> - MininalRoute = [{'_', []}], - [{_SingleHost, MininalPath}] = MininalRoute, - ExpectedResponse = cowboy_router:compile(MininalRoute), - ExpectedResponse = trails:single_host_compile(MininalPath), + MinimalRoute = [{'_', []}], + [{_SingleHost, MinimalPath}] = MinimalRoute, + ExpectedResponse = cowboy_router:compile(MinimalRoute), + ExpectedResponse = trails:single_host_compile(MinimalPath), {comment, ""}. -spec basic_single_host_compile_test(config()) -> {atom(), string()}.