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

Does not respect :follow_redirects from process_options #100

Closed
ctreatma opened this issue Oct 15, 2016 · 0 comments
Closed

Does not respect :follow_redirects from process_options #100

ctreatma opened this issue Oct 15, 2016 · 0 comments

Comments

@ctreatma
Copy link
Contributor

When HTTPotion.Base is extended to create an API client, that API client will not follow redirects even if :follow_redirects is set to true by process_options. For example, the below API client will not follow redirects:

defmodule RedirectingClient do
  use HTTPotion.Base

  def process_options(options) do
    Keyword.put(options, :follow_redirects, true)
  end
end
ctreatma added a commit to ctreatma/httpotion that referenced this issue Oct 15, 2016
API clients that are built by extending `HTTPotion.Base`
can use the `process_options` hook to ensure that all
redirects will be followed automatically. A typo in that
module caused `follow_redirects` to be ignored.

This adds a test to specifically cover the behavior of
an API client using `process_options` to inject a `true`
value for `follow_redirects`, and fixes the typo.
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

No branches or pull requests

1 participant