Skip to content

Commit

Permalink
no need for the Location in the case
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Mar 25, 2016
1 parent 04f960e commit 66a5329
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hackney.erl
Original file line number Diff line number Diff line change
Expand Up @@ -762,16 +762,16 @@ maybe_redirect1(Location, {ok, S, H, #client{retries=Tries}=Client}=Resp, Req) -
%% different from get or head it will return
%% `{ok, {maybe_redirect, Status, Headers, Client}}' to let
%% the user make his choice.
case {Location, lists:member(Method, [get, head])} of
{_, true} ->
case lists:member(Method, [get, head]) of
true ->
NewReq = {Method, Location, Headers, Body},
maybe_redirect(redirect(Client#client{retries=Tries-1}, NewReq),
Req);
{_, _} when Client#client.force_redirect =:= true ->
false when Client#client.force_redirect =:= true ->
NewReq = {Method, Location, Headers, Body},
maybe_redirect(redirect(Client#client{retries=Tries-1}, NewReq),
Req);
{_, _} ->
false ->
{ok, {maybe_redirect, S, H, Client}}
end;
false when S =:= 303 andalso (Method =:= post orelse
Expand Down

0 comments on commit 66a5329

Please sign in to comment.