Skip to content

Commit

Permalink
Handle the special case /vhosts/root
Browse files Browse the repository at this point in the history
  • Loading branch information
amr committed May 3, 2010
1 parent 7e4f8f3 commit e0f8670
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rest/controllers/vhosts.erl
Expand Up @@ -7,6 +7,7 @@
% list_vhosts

get([]) -> {?MODULE, get_all_vhosts()};
get(["root"]) -> ?MODULE:get(["/"]);
get([Id]) ->
Vhosts = lists:map(fun(U) -> erlang:binary_to_list(U) end, get_all_vhosts()),
case lists:member(Id, Vhosts) of
Expand Down Expand Up @@ -40,4 +41,4 @@ get_all_vhosts() ->
case rabint:call({rabbit_access_control, list_vhosts, []}) of
{_Error, _} -> erlang:list_to_binary([<<"no vhosts">>]);
Bin -> Bin
end.
end.

0 comments on commit e0f8670

Please sign in to comment.