Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit 35ab67f

Browse files
committed
Fix rabbit_cowboy_redirect and remove unused optional callbacks
The handler rabbit_cowboy_redirect was apparently not converted to Cowboy 2. It should work properly now.
1 parent 463849e commit 35ab67f

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/rabbit_cowboy_redirect.erl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,9 @@
1616

1717
-module(rabbit_cowboy_redirect).
1818

19-
-export([init/3]).
20-
-export([handle/2]).
21-
-export([terminate/3]).
19+
-export([init/2]).
2220

23-
init(_, Req, RedirectPort) ->
24-
{ok, Req, RedirectPort}.
25-
26-
handle(Req0, RedirectPort) ->
21+
init(Req0, RedirectPort) ->
2722
URI = cowboy_req:uri(Req0, #{port => RedirectPort}),
2823
Req = cowboy_req:reply(301, #{<<"location">> => URI}, Req0),
2924
{ok, Req, RedirectPort}.
30-
31-
terminate(_, _, _) ->
32-
ok.

src/rabbit_web_dispatch_listing_handler.erl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
-module(rabbit_web_dispatch_listing_handler).
1818

1919
-export([init/2]).
20-
-export([terminate/3]).
2120

2221
init(Req0, Listener) ->
2322
HTMLPrefix =
@@ -35,6 +34,3 @@ init(Req0, Listener) ->
3534
end,
3635
Req = cowboy_req:reply(200, #{}, [HTMLPrefix, List, HTMLSuffix], Req0),
3736
{ok, Req, Listener}.
38-
39-
terminate(_, _, _) ->
40-
ok.

0 commit comments

Comments
 (0)