Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognize lowercase location header (fix #453) #454

Merged
merged 1 commit into from Mar 31, 2022

Conversation

gianluca-nitti
Copy link
Contributor

@gianluca-nitti gianluca-nitti commented Jan 26, 2022

As the title says, my simple fix to issue #453 with its test case.

@@ -952,7 +952,16 @@ defmodule HTTPoison.Base do
headers: process_response_headers.(headers),
request: request,
request_url: request.url,
redirect_url: :proplists.get_value("Location", headers, nil)
redirect_url: get_header(headers, "Location", nil)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could use :hackney_headers.get_value given that we already have hackney as a dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look and gave it a try but it fails because that function (and :hackney_headers_new.get_value as well) expects the headers to be an Erlang dict while here it's a proplist (still haven't investigated why).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right! I didn't notice that! As you were then 😬

@edgurgel
Copy link
Owner

Thanks for the PR! It makes total sense to fix this! I've added a comment but other than that everything looks great! Thanks for adding a test case

@vereis
Copy link
Contributor

vereis commented Mar 30, 2022

Thanks for fixing my mistake!

@edgurgel edgurgel merged commit 6b6ad05 into edgurgel:master Mar 31, 2022
@edgurgel
Copy link
Owner

Sorry for the long wait!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants