Fix redirect handling not working with HTTPoison

This commit is contained in:
Shadowfacts 2021-03-31 15:29:52 -04:00
parent e10a614f3e
commit 0ded09a65d
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 2 additions and 2 deletions

View File

@ -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} ->