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

Follow redirects #58

Closed
dblock opened this issue Aug 26, 2014 · 2 comments
Closed

Follow redirects #58

dblock opened this issue Aug 26, 2014 · 2 comments

Comments

@dblock
Copy link
Collaborator

dblock commented Aug 26, 2014

I think hyperclient should by default follow redirects, which means adding to

faraday.adapter :net_http
:

        faraday.use FaradayMiddleware::FollowRedirects

Currently monkey-patching

require 'hyperclient/entry_point'

module Hyperclient
  class EntryPoint < Link
    def default_faraday_block
      lambda do |faraday|
        faraday.use FaradayMiddleware::FollowRedirects
        faraday.request  :json
        faraday.response :json, content_type: /\bjson$/
        faraday.adapter :net_http
      end
    end
  end
end

Thoughts?

@oriolgual
Copy link
Member

I don't see why not, can you submit a PR?

@dblock
Copy link
Collaborator Author

dblock commented Sep 18, 2014

Bump @oriolgual .

oriolgual added a commit that referenced this issue Sep 26, 2014
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

2 participants