1841 Commits

Author SHA1 Message Date
Matt
4024f4d402
Version bump to 2.6.0 v2.6.0 2022-10-03 17:27:35 +01:00
Yutaka Kamei
fe6e71bbe0
Update @param of methods on Connection (#1452) 2022-10-03 14:29:08 +01:00
Joe Swatosh
e1dbdf065e
Forward the env to Request::Authorization#header_from (#1450) 2022-10-03 13:20:07 +01:00
mi-wada
7926e3aa89
docs: fix usage page to match latest version's default adapter specification (#1447) 2022-09-05 17:11:48 +02:00
Felix Yan
4816043101 Correct a typo inUPGRADING.md 2022-08-28 16:12:28 +02:00
Matt
b3b922949d
Version bump to 2.5.2 v2.5.2 2022-08-11 13:48:46 +01:00
Matt
89b1fe3da9
Explicitly pass reason_phrase to save_response in test adapter. (#1445)
Fixes #1444
2022-08-11 13:48:13 +01:00
Matt
43d6797770
Enables and fixes all new cops. (#1443) 2022-08-08 15:46:54 +01:00
Mattia Giuffrida
5e01af3828 Version bump to 2.5.1 v2.5.1 2022-08-08 14:29:52 +01:00
Mattia Giuffrida
646c30b8cb Allow faraday-net_http up to v3.1
Version 3.0 of `faraday-net_http` uses the new streaming API and the new `finished` option in `save_response`, which are not available in `faraday` prior to version 2.5, and has therefore been released as a new major version.

To avoid the same issue in future, we're fixing the version to allow any 3.0.x version, but not 3.1+.
This will allow us to ship a minor versions of the adapter with "breaking" changes for older versions of Faraday.
2022-08-08 14:29:24 +01:00
Matt
591b58fc06
Version bump to 2.5.0 v2.5.0 2022-08-08 12:29:03 +01:00
Sampat Badhe
1ddf062331
Fix documentation typo (#1441) 2022-08-08 12:26:02 +01:00
Mattia Giuffrida
1a5b794b88 Disable new streaming API specific tests 2022-08-08 12:23:09 +01:00
Mattia Giuffrida
8a6a12100d Update CI matrix:
* Make `truffleruby-head` experimental
* Add `ruby-head` as experimental
2022-08-08 12:23:09 +01:00
Mattia Giuffrida
6799f5852d Introduce new streaming API (#1439)
* Backwards-compatible
* Allow adapters to provide response info to on_call block
* Provide `stream_response` helper method
2022-08-08 12:23:09 +01:00
Mattia Giuffrida
5d4c1fb962 Temporarily use edge rubocop-packaging 2022-08-08 12:23:09 +01:00
Mattia Giuffrida
af116aa0a3 Add bake-test-external and test faraday-net_http as part of the CI 2022-08-08 12:23:09 +01:00
Matt
7f444c3971 Add encoders #sort_params to documentation
Fixes #1429
2022-08-01 09:56:38 +02:00
Matt
69e88b4d52
Version bump to 2.4.0 v2.4.0 2022-07-28 10:04:18 +01:00
Yutaka Kamei
cfbea91a69
Support Proc type for stubbed request body (#1436)
Previously, the Faraday testing adapter compared the request body to the
stubbed body just by calling `#==` if the stubbed body is present.
Sometimes, I want to check the equality between request and stubbed body
in more advanced ways. For example, there is a case that I want to check
only the parts of the body are actually passed to Faraday instance like
this:

```ruby
stubs = Faraday::Adapter::Test::Stubs.new do |stub|
  stub.post('/foo', '{"name:"YK","created_at":"ANY STRING IS OK"}') { [200, {}, ''] }
end
connection.post('/foo', JSON.dump(name: 'YK', created_at: Time.now))
stubs.verify_stubbed_calls
```

In this case, it's difficult to make tests always pass with
`"created_at"` because the value is dynamic. So, I came up with an idea
to pass a proc as a stubbed value and compare bodies, inside the proc:

```ruby
stubs = Faraday::Adapter::Test::Stubs.new do |stub|
  check = -> (request_body) { JSON.parse(request_body).slice('name') == { 'name' => 'YK' } }
  stub.post('/foo', check) { [200, {}, ''] }
end
connection.post('/foo', JSON.dump(name: 'YK', created_at: Time.now))
stubs.verify_stubbed_calls
```

I believe this would be flexible but compatible with the previous behavior.
2022-07-28 10:03:13 +01:00
sampatbadhe
fecc0a24cb Fix syntax to use correct doc link for url_encoded 2022-07-25 16:47:43 +02:00
Jason Karns
607a725719 Move JsonResponse middleware to response section
The JsonResponse middleware was listed under the Request middleware section for some reason.
2022-07-24 16:11:41 +02:00
水上 皓登
9d4486616a docs link fixed 2022-07-08 17:16:39 +02:00
Konstantin S Kazarin
d420a12a57
Handle verify hostname ssl option (#1428) 2022-06-30 22:26:16 +01:00
Olle Jonsson
fcb2003178
docs: Update to 2022 (#1420) 2022-05-23 14:24:45 +01:00
Matt
71a70f1d8c Remove examples using extension middleware
People want to copy documentation snippets and use them, so they should be compatible with what Faraday offers out-of-the-box.
Fixes #1417
2022-05-17 11:06:50 +02:00
Matt
6ea010be93
Version bump to 2.3.0 v2.3.0 2022-05-06 16:26:46 +01:00
Olle Jonsson
257268e0c8
CI: Update GitHub Action "checkout" to v3 (#1416) 2022-05-06 16:10:46 +01:00
Chris AtLee
a2b5f7f3a8
Allow application/x-www-form-url_encoded POST requests to use file objects as the request body (#1415) 2022-05-06 15:49:09 +01:00
Thong Kuah
56d58442e5 docs: Correct default default_adapter value
Since https://github.com/lostisland/faraday/pull/1366, the default value for `default_adapter` is `:net_http`.

Fixes https://www.rubydoc.info/gems/faraday/Faraday#default_adapter-class_method
2022-05-03 06:18:24 +02:00
Nicolas Svirchevsky
24eafaa99a
Doc: Added raise_error middleware configuration (#1412) 2022-04-27 15:52:38 +01:00
Matt
24b3fd36e6
Clarifies removal of net_http from v2.0
Adds an explicit not to explain that the `net_http` adapter was originally removed from 2.0 and reintroduced in 2.0.1.
Fixes #1409
2022-03-31 10:35:17 +01:00
Alexander Popov
8f00640dd5 Update custom middleware documentation
Add a section with link to the repo with template.
2022-02-23 21:09:13 +01:00
Joshua Bremer
fc11225474 Add one more require to the quickstart to make this whole thing work immediately 2022-02-18 16:34:22 +01:00
Thomas Sanchez
f003443acc
Add indices when arrays are encoded (#1399) 2022-02-16 10:05:38 +00:00
Olle Jonsson
b2390ec2b3
docs: UPGRADE Note #dependency removed in 2.0 (#1398)
This adds a missing explanation to the UPGRADE document. Anyone searching for `dependency` should be able to find this section.
2022-02-07 10:41:52 +00:00
Olle Jonsson
3fc35dac23
CHANGELOG: add 2.2.0 section (#1394) 2022-02-03 09:50:54 +00:00
Matt
948274e25e
Version bump to 2.2.0 v2.2.0 2022-02-03 09:36:00 +00:00
Olle Jonsson
46f3b678f0 Refactor test
This avoids leaking the class definition.
2022-02-02 20:24:49 +01:00
Mattia Giuffrida
85dfdf824c Re-add register middleware w/ Symbol, String, Proc
Reintroduce the possibility to register middleware with symbols, strings or procs.

Fixes #1389
2022-02-02 20:24:49 +01:00
Olle Jonsson
33563e3d63 docs: Amend CHANGELOG, link to Releases 2022-02-02 16:07:43 +01:00
Andrew Haines
26d47ca5bb
Remove Faraday 2.0 alpha warning from README (#1385) 2022-01-19 18:59:09 +00:00
José Augusto
816d824bc1
Removing all sushi.com references and change to httpbingo.org (#1384)
Fixes #1164
2022-01-18 16:43:36 +00:00
José Augusto
9f80f875f7
Update docs to use httpbingo on example requests and add webrick for ruby 3.x support (#1383) 2022-01-18 10:44:16 +00:00
Matt
ae55a744d1
Version bump to 2.1.0 v2.1.0 2022-01-15 14:34:05 +00:00
Yuki Hirasawa
7f004913eb
Add default adapter options (#1382) 2022-01-15 14:32:39 +00:00
Matt
577f0d3e75
Fix test adapter thread safety (#1380) 2022-01-15 08:58:30 +00:00
Matt
996028a165
Introduce mutex Monitor in Faraday::Test::Stubs (#1379)
Fixes #1365
2022-01-12 15:56:25 +00:00
Yuki Hirasawa
026e9569a1
docs: fix regex pattern in logger.md examples (#1378) 2022-01-11 14:26:06 +00:00
Peter Goldstein
295f112356
Add Ruby 3.1 to CI (#1374) 2022-01-07 22:08:29 +00:00