Skip to content

Follow redirects, fixes #58. #60

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

Merged
merged 1 commit into from
Sep 26, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
== Next
* enhancements
* [#58](https://github.com/codegram/hyperclient/issues/58): Automatically follow redirects (by [@dblock](https://github.com/dblock)).

== 0.3.1
* backwards incompatible changes
* Nothing
* Nothing.

* enhancements
* Support arrays of Links (by @rehevkor5)
* Support arrays of Links (by @rehevkor5).
* Created the CHANGELOG.

* bug fix
* Nothing
* bug fixes
* Nothing.

* deprecations
* Nothing
* Nothing.
1 change: 1 addition & 0 deletions lib/hyperclient/entry_point.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def connection
# Returns a block.
def default_faraday_block
lambda do |faraday|
faraday.use FaradayMiddleware::FollowRedirects
faraday.request :json
faraday.response :json, content_type: /\bjson$/
faraday.adapter :net_http
Expand Down
3 changes: 2 additions & 1 deletion test/hyperclient/entry_point_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module Hyperclient

it 'creates a Faraday connection with the default block' do
handlers = entry_point.connection.builder.handlers
handlers.must_include FaradayMiddleware::FollowRedirects
handlers.must_include FaradayMiddleware::EncodeJson
handlers.must_include FaradayMiddleware::ParseJson
handlers.must_include Faraday::Adapter::NetHttp
Expand All @@ -31,4 +32,4 @@ module Hyperclient
end
end
end
end
end