Skip to content

Commit

Permalink
Minor fix: GET/HEAD method on non existing shovel crash
Browse files Browse the repository at this point in the history
(cherry picked from commit 16463e7)
  • Loading branch information
SimonUnge authored and mergify[bot] committed Aug 29, 2024
1 parent 16c95b9 commit 93bae7f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions deps/rabbitmq_shovel_management/src/rabbit_shovel_mgmt_shovel.erl
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,22 @@ resource_exists(ReqData, Context) ->
case name(ReqData) of
none -> true;
Name ->
%% Deleting or restarting a shovel
case get_shovel_node(VHost, Name, ReqData, Context) of
undefined ->
rabbit_log:error("Shovel with the name '~ts' was not found on virtual host '~ts'. "
"It may be failing to connect and report its status.",
[Name, VHost]),
case is_restart(ReqData) of
true -> false;
%% this is a deletion attempt, it can continue and idempotently try to
%% delete the shovel
false -> true
case cowboy_req:method(ReqData) of
<<"DELETE">> ->
%% Deleting or restarting a shovel
case is_restart(ReqData) of
true -> false;
%% this is a deletion attempt, it can continue and idempotently try to
%% delete the shovel
false -> true
end;
_ ->
false
end;
_ ->
true
Expand Down

0 comments on commit 93bae7f

Please sign in to comment.