faraday 2.7.2 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.md +1 -1
- data/README.md +9 -9
- data/lib/faraday/adapter/test.rb +1 -1
- data/lib/faraday/connection.rb +9 -10
- data/lib/faraday/options/env.rb +13 -7
- data/lib/faraday/response.rb +2 -1
- data/lib/faraday/version.rb +1 -1
- data/spec/faraday/response_spec.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee818ac3a13f048f8abe9e53b2cc86f9f8528d67deb562f8a8b52840adc2735a
|
4
|
+
data.tar.gz: dbaf3fb64a55ca17c7feebacdeefac5887d1270b4fc56a6fa7ef93aac0d14096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 698d48a4ae363b14d9dddffbb131ef58432c2e2403d9a6bd5606bbb8998c10d81428ae8749ace13bb5e0fd274bdac026d2c830aa047d6ed2f3b9d1a11df11c34
|
7
|
+
data.tar.gz: 035e04cbb3a190754f5754a0311b1008cfff3c0a8244e7f5e83b3306e719774215ead14e4d218db4f1f95b3e2c5679e9db675e25085748ea922e9d3034206654
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
[](https://github.com/lostisland/faraday/actions?query=workflow%3ACI)
|
5
5
|
[](https://github.com/lostisland/faraday/discussions)
|
6
6
|
|
7
|
-
|
8
7
|
Faraday is an HTTP client library abstraction layer that provides a common interface over many
|
9
8
|
adapters (such as Net::HTTP) and embraces the concept of Rack middleware when processing the request/response cycle.
|
10
9
|
You probably don't want to use Faraday directly in your project, as it will lack an actual client library to perform
|
@@ -42,14 +41,15 @@ Open the issues page and check for the `help wanted` label!
|
|
42
41
|
But before you start coding, please read our [Contributing Guide][contributing]
|
43
42
|
|
44
43
|
## Copyright
|
45
|
-
© 2009 - 2022, the [Faraday Team][faraday_team]. Website and branding design by [Elena Lo Piccolo](https://elelopic.design).
|
46
44
|
|
47
|
-
[
|
48
|
-
|
45
|
+
© 2009 - 2023, the [Faraday Team][faraday_team]. Website and branding design by [Elena Lo Piccolo](https://elelopic.design).
|
46
|
+
|
47
|
+
[awesome]: https://github.com/lostisland/awesome-faraday/#adapters
|
48
|
+
[website]: https://lostisland.github.io/faraday
|
49
49
|
[faraday_team]: https://lostisland.github.io/faraday/team
|
50
50
|
[contributing]: https://github.com/lostisland/faraday/blob/master/.github/CONTRIBUTING.md
|
51
|
-
[apidoc]:
|
52
|
-
[actions]:
|
53
|
-
[jruby]:
|
54
|
-
[rubinius]:
|
55
|
-
[license]:
|
51
|
+
[apidoc]: https://www.rubydoc.info/github/lostisland/faraday
|
52
|
+
[actions]: https://github.com/lostisland/faraday/actions
|
53
|
+
[jruby]: http://jruby.org/
|
54
|
+
[rubinius]: http://rubini.us/
|
55
|
+
[license]: LICENSE.md
|
data/lib/faraday/adapter/test.rb
CHANGED
data/lib/faraday/connection.rb
CHANGED
@@ -220,7 +220,7 @@ module Faraday
|
|
220
220
|
# @yield [Faraday::Request] for further request customizations
|
221
221
|
# @return [Faraday::Response]
|
222
222
|
def options(*args)
|
223
|
-
return @options if args.
|
223
|
+
return @options if args.empty?
|
224
224
|
|
225
225
|
url, params, headers = *args
|
226
226
|
run_request(:options, url, nil, headers) do |request|
|
@@ -261,14 +261,13 @@ module Faraday
|
|
261
261
|
# @param headers [Hash, nil] unencoded HTTP header key/value pairs.
|
262
262
|
#
|
263
263
|
# @example
|
264
|
-
#
|
265
|
-
# conn.post '/items', data, content_type: 'application/json'
|
264
|
+
# conn.put '/products/123', data, content_type: 'application/json'
|
266
265
|
#
|
267
|
-
# #
|
268
|
-
# conn.
|
269
|
-
# req.headers[
|
270
|
-
# req.
|
271
|
-
# req.
|
266
|
+
# # Star a gist.
|
267
|
+
# conn.put 'https://api.github.com/gists/GIST_ID/star' do |req|
|
268
|
+
# req.headers['Accept'] = 'application/vnd.github+json'
|
269
|
+
# req.headers['Authorization'] = 'Bearer <YOUR-TOKEN>'
|
270
|
+
# req.headers['X-GitHub-Api-Version'] = '2022-11-28'
|
272
271
|
# end
|
273
272
|
#
|
274
273
|
# @yield [Faraday::Request] for further request customizations
|
@@ -471,10 +470,10 @@ module Faraday
|
|
471
470
|
def build_exclusive_url(url = nil, params = nil, params_encoder = nil)
|
472
471
|
url = nil if url.respond_to?(:empty?) && url.empty?
|
473
472
|
base = url_prefix.dup
|
474
|
-
if url && base.path
|
473
|
+
if url && !base.path.end_with?('/')
|
475
474
|
base.path = "#{base.path}/" # ensure trailing slash
|
476
475
|
end
|
477
|
-
url = url.to_s.gsub(':', '%3A') if
|
476
|
+
url = url.to_s.gsub(':', '%3A') if Utils.URI(url.to_s).opaque
|
478
477
|
uri = url ? base + url : base
|
479
478
|
if params
|
480
479
|
uri.query = params.to_query(params_encoder || options.params_encoder)
|
data/lib/faraday/options/env.rb
CHANGED
@@ -15,13 +15,19 @@ module Faraday
|
|
15
15
|
# @return [Hash] options for configuring the request.
|
16
16
|
# Options for configuring the request.
|
17
17
|
#
|
18
|
-
# - `:timeout`
|
19
|
-
#
|
20
|
-
# - `:
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
18
|
+
# - `:timeout` - time limit for the entire request (Integer in
|
19
|
+
# seconds)
|
20
|
+
# - `:open_timeout` - time limit for just the connection phase (e.g.
|
21
|
+
# handshake) (Integer in seconds)
|
22
|
+
# - `:read_timeout` - time limit for the first response byte received from
|
23
|
+
# the server (Integer in seconds)
|
24
|
+
# - `:write_timeout` - time limit for the client to send the request to the
|
25
|
+
# server (Integer in seconds)
|
26
|
+
# - `:on_data` - Proc for streaming
|
27
|
+
# - `:proxy` - Hash of proxy options
|
28
|
+
# - `:uri` - Proxy server URI
|
29
|
+
# - `:user` - Proxy server username
|
30
|
+
# - `:password` - Proxy server password
|
25
31
|
#
|
26
32
|
# @!attribute request_headers
|
27
33
|
# @return [Hash] HTTP Headers to be sent to the server.
|
data/lib/faraday/response.rb
CHANGED
data/lib/faraday/version.rb
CHANGED
@@ -4,7 +4,7 @@ RSpec.describe Faraday::Response do
|
|
4
4
|
subject { Faraday::Response.new(env) }
|
5
5
|
|
6
6
|
let(:env) do
|
7
|
-
Faraday::Env.from(status: 404, body: 'yikes',
|
7
|
+
Faraday::Env.from(status: 404, body: 'yikes', url: Faraday::Utils.URI('https://lostisland.github.io/faraday'),
|
8
8
|
response_headers: { 'Content-Type' => 'text/plain' })
|
9
9
|
end
|
10
10
|
|
@@ -30,6 +30,7 @@ RSpec.describe Faraday::Response do
|
|
30
30
|
it { expect(hash[:status]).to eq(subject.status) }
|
31
31
|
it { expect(hash[:response_headers]).to eq(subject.headers) }
|
32
32
|
it { expect(hash[:body]).to eq(subject.body) }
|
33
|
+
it { expect(hash[:url]).to eq(subject.env.url) }
|
33
34
|
end
|
34
35
|
|
35
36
|
describe 'marshal serialization support' do
|
@@ -45,6 +46,7 @@ RSpec.describe Faraday::Response do
|
|
45
46
|
it { expect(loaded.env[:body]).to eq(env[:body]) }
|
46
47
|
it { expect(loaded.env[:response_headers]).to eq(env[:response_headers]) }
|
47
48
|
it { expect(loaded.env[:status]).to eq(env[:status]) }
|
49
|
+
it { expect(loaded.env[:url]).to eq(env[:url]) }
|
48
50
|
end
|
49
51
|
|
50
52
|
describe '#on_complete' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "@technoweenie"
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2023-01-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday-net_http
|
@@ -131,7 +131,7 @@ licenses:
|
|
131
131
|
- MIT
|
132
132
|
metadata:
|
133
133
|
homepage_uri: https://lostisland.github.io/faraday
|
134
|
-
changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.7.
|
134
|
+
changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.7.3
|
135
135
|
source_code_uri: https://github.com/lostisland/faraday
|
136
136
|
bug_tracker_uri: https://github.com/lostisland/faraday/issues
|
137
137
|
post_install_message:
|