Skip to content

Commit f4f1ba9

Browse files
committed
Follow redirects, fixes #58.
1 parent ff3e85c commit f4f1ba9

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

CHANGELOG.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
== Next
2+
* enhancements
3+
* [#58](https://github.com/codegram/hyperclient/issues/58): Automatically follow redirects (by [@dblock](https://github.com/dblock)).
4+
15
== 0.3.1
26
* backwards incompatible changes
3-
* Nothing
7+
* Nothing.
48

59
* enhancements
6-
* Support arrays of Links (by @rehevkor5)
10+
* Support arrays of Links (by @rehevkor5).
711
* Created the CHANGELOG.
812

9-
* bug fix
10-
* Nothing
13+
* bug fixes
14+
* Nothing.
1115

1216
* deprecations
13-
* Nothing
17+
* Nothing.

lib/hyperclient/entry_point.rb

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def connection
4242
# Returns a block.
4343
def default_faraday_block
4444
lambda do |faraday|
45+
faraday.use FaradayMiddleware::FollowRedirects
4546
faraday.request :json
4647
faraday.response :json, content_type: /\bjson$/
4748
faraday.adapter :net_http

test/hyperclient/entry_point_test.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module Hyperclient
1919

2020
it 'creates a Faraday connection with the default block' do
2121
handlers = entry_point.connection.builder.handlers
22+
handlers.must_include FaradayMiddleware::FollowRedirects
2223
handlers.must_include FaradayMiddleware::EncodeJson
2324
handlers.must_include FaradayMiddleware::ParseJson
2425
handlers.must_include Faraday::Adapter::NetHttp
@@ -31,4 +32,4 @@ module Hyperclient
3132
end
3233
end
3334
end
34-
end
35+
end

0 commit comments

Comments
 (0)