From 0ded09a65df2808ad296d8b9900f3921535635ef Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 31 Mar 2021 15:29:52 -0400 Subject: [PATCH] Fix redirect handling not working with HTTPoison --- lib/frenzy/network.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/frenzy/network.ex b/lib/frenzy/network.ex index 537fc77..6edaf62 100644 --- a/lib/frenzy/network.ex +++ b/lib/frenzy/network.ex @@ -12,9 +12,9 @@ defmodule Frenzy.Network do {:ok, %HTTPoison.Response{status_code: status_code, headers: headers}} when status_code in @http_redirect_codes -> headers - |> Enum.find(fn {name, _value} -> name == "location" end) + |> Enum.find(fn {name, _value} -> String.downcase(name) == "location" end) |> case do - {"location", new_url} -> + {_, new_url} -> new_url = case URI.parse(new_url) do %URI{host: nil, path: path} ->