Skip to content

Commit

Permalink
mod_spam_filters: gracefully handle missing location header
Browse files Browse the repository at this point in the history
  • Loading branch information
sstrigler committed Jan 9, 2025
1 parent e8ed1d0 commit 4efbfe0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mod_spam_filter/src/mod_spam_filter.erl
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,12 @@ do_resolve_redirects([URL | Rest], Acc) ->
of
{ok, {{_, Moved, _}, Headers, _Body}} when Moved >= 300, Moved < 400 ->
Location = proplists:get_value("location", Headers),
case lists:member(Location, Acc) of
false ->
do_resolve_redirects([Location | Rest], [URL | Acc]);
case Location == undefined orelse lists:member(Location, Acc) of
true ->
do_resolve_redirects(Rest, [URL | Acc])
end;
do_resolve_redirects(Rest, [URL | Acc]);
false ->
do_resolve_redirects([Location | Rest], [URL | Acc])
end;
_Res ->
do_resolve_redirects(Rest, [URL | Acc])
end.
Expand Down

0 comments on commit 4efbfe0

Please sign in to comment.