faraday 0.15.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +570 -0
  3. data/LICENSE.md +1 -1
  4. data/README.md +25 -351
  5. data/Rakefile +7 -0
  6. data/examples/client_spec.rb +97 -0
  7. data/examples/client_test.rb +118 -0
  8. data/lib/faraday/adapter/test.rb +127 -72
  9. data/lib/faraday/adapter.rb +69 -22
  10. data/lib/faraday/adapter_registry.rb +30 -0
  11. data/lib/faraday/connection.rb +309 -232
  12. data/lib/faraday/encoders/flat_params_encoder.rb +105 -0
  13. data/lib/faraday/encoders/nested_params_encoder.rb +176 -0
  14. data/lib/faraday/error.rb +119 -38
  15. data/lib/faraday/logging/formatter.rb +106 -0
  16. data/lib/faraday/methods.rb +6 -0
  17. data/lib/faraday/middleware.rb +18 -25
  18. data/lib/faraday/middleware_registry.rb +83 -0
  19. data/lib/faraday/options/connection_options.rb +22 -0
  20. data/lib/faraday/options/env.rb +181 -0
  21. data/lib/faraday/options/proxy_options.rb +32 -0
  22. data/lib/faraday/options/request_options.rb +22 -0
  23. data/lib/faraday/options/ssl_options.rb +59 -0
  24. data/lib/faraday/options.rb +41 -195
  25. data/lib/faraday/parameters.rb +4 -196
  26. data/lib/faraday/rack_builder.rb +91 -76
  27. data/lib/faraday/request/authorization.rb +37 -29
  28. data/lib/faraday/request/instrumentation.rb +47 -27
  29. data/lib/faraday/request/json.rb +55 -0
  30. data/lib/faraday/request/url_encoded.rb +45 -23
  31. data/lib/faraday/request.rb +74 -32
  32. data/lib/faraday/response/json.rb +54 -0
  33. data/lib/faraday/response/logger.rb +22 -69
  34. data/lib/faraday/response/raise_error.rb +57 -14
  35. data/lib/faraday/response.rb +26 -33
  36. data/lib/faraday/utils/headers.rb +139 -0
  37. data/lib/faraday/utils/params_hash.rb +61 -0
  38. data/lib/faraday/utils.rb +47 -251
  39. data/lib/faraday/version.rb +5 -0
  40. data/lib/faraday.rb +108 -199
  41. data/spec/external_adapters/faraday_specs_setup.rb +14 -0
  42. data/spec/faraday/adapter/test_spec.rb +377 -0
  43. data/spec/faraday/adapter_registry_spec.rb +28 -0
  44. data/spec/faraday/adapter_spec.rb +55 -0
  45. data/spec/faraday/connection_spec.rb +787 -0
  46. data/spec/faraday/error_spec.rb +60 -0
  47. data/spec/faraday/middleware_registry_spec.rb +31 -0
  48. data/spec/faraday/middleware_spec.rb +52 -0
  49. data/spec/faraday/options/env_spec.rb +70 -0
  50. data/spec/faraday/options/options_spec.rb +297 -0
  51. data/spec/faraday/options/proxy_options_spec.rb +44 -0
  52. data/spec/faraday/options/request_options_spec.rb +19 -0
  53. data/spec/faraday/params_encoders/flat_spec.rb +42 -0
  54. data/spec/faraday/params_encoders/nested_spec.rb +142 -0
  55. data/spec/faraday/rack_builder_spec.rb +317 -0
  56. data/spec/faraday/request/authorization_spec.rb +83 -0
  57. data/spec/faraday/request/instrumentation_spec.rb +74 -0
  58. data/spec/faraday/request/json_spec.rb +111 -0
  59. data/spec/faraday/request/url_encoded_spec.rb +82 -0
  60. data/spec/faraday/request_spec.rb +109 -0
  61. data/spec/faraday/response/json_spec.rb +117 -0
  62. data/spec/faraday/response/logger_spec.rb +220 -0
  63. data/spec/faraday/response/raise_error_spec.rb +172 -0
  64. data/spec/faraday/response_spec.rb +75 -0
  65. data/spec/faraday/utils/headers_spec.rb +82 -0
  66. data/spec/faraday/utils_spec.rb +117 -0
  67. data/spec/faraday_spec.rb +37 -0
  68. data/spec/spec_helper.rb +132 -0
  69. data/spec/support/disabling_stub.rb +14 -0
  70. data/spec/support/fake_safe_buffer.rb +15 -0
  71. data/spec/support/helper_methods.rb +96 -0
  72. data/spec/support/shared_examples/adapter.rb +104 -0
  73. data/spec/support/shared_examples/params_encoder.rb +18 -0
  74. data/spec/support/shared_examples/request_method.rb +249 -0
  75. data/spec/support/streaming_response_checker.rb +35 -0
  76. metadata +86 -34
  77. data/lib/faraday/adapter/em_http.rb +0 -243
  78. data/lib/faraday/adapter/em_http_ssl_patch.rb +0 -56
  79. data/lib/faraday/adapter/em_synchrony/parallel_manager.rb +0 -66
  80. data/lib/faraday/adapter/em_synchrony.rb +0 -106
  81. data/lib/faraday/adapter/excon.rb +0 -79
  82. data/lib/faraday/adapter/httpclient.rb +0 -128
  83. data/lib/faraday/adapter/net_http.rb +0 -137
  84. data/lib/faraday/adapter/net_http_persistent.rb +0 -63
  85. data/lib/faraday/adapter/patron.rb +0 -100
  86. data/lib/faraday/adapter/rack.rb +0 -58
  87. data/lib/faraday/adapter/typhoeus.rb +0 -12
  88. data/lib/faraday/autoload.rb +0 -84
  89. data/lib/faraday/request/basic_authentication.rb +0 -13
  90. data/lib/faraday/request/multipart.rb +0 -68
  91. data/lib/faraday/request/retry.rb +0 -211
  92. data/lib/faraday/request/token_authentication.rb +0 -15
  93. data/lib/faraday/upload_io.rb +0 -67
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3737507d92b48e4b98e891c5026210048ab70b2b1ee17ea20993b8ffc65eafb5
4
- data.tar.gz: caaaa7f7ad1bdda848ac7bc70d4d1b9ba9d06bc85912a61b1ee4082086629a26
3
+ metadata.gz: eaa5f5a3ea91b21a40ad7872a8eda558226e1d5f4d8f9875ecf9ece44e0181e4
4
+ data.tar.gz: 51af319bffd649b4b828cfed91b2a419211b1c2b171a3016949388b1a749c1ac
5
5
  SHA512:
6
- metadata.gz: 231b96efdd5b0399f204edaeba22d01661b9d301aff6cad7d097c27c1e95f0a0a8adc9184e88f089862fa9db9a833e50a3eb7bfb96034a2df7f1bdd93661f3fb
7
- data.tar.gz: f19fca5f59454b7b620160c3e58339e0dff8049be29bda8e8f1a494455dac6c62a1c6cbe4b4e141e999ea3df25cbcdf3ef09d65e93d71a882c318c75c3070dec
6
+ metadata.gz: b68ff300b45dbe3a7f85ab40f7a23c86b2c373a1672841a96230179f415da3f3bcf2123251235c4399575826043f7221fe81615171fbfd3af4d33a21410f8670
7
+ data.tar.gz: 41cd332afaf70ea6e306247b3f2ea9d9e38ed248e381aef798f914773b1dd7c7473ab9a6fcb5e03cb8e7163c0f81f26e813877bb5f7412964e55ddb9866ffe20
data/CHANGELOG.md ADDED
@@ -0,0 +1,570 @@
1
+ # Faraday Changelog
2
+
3
+ ## The changelog has moved!
4
+
5
+ This file is not being updated anymore. Instead, please check the [Releases](https://github.com/lostisland/faraday/releases) page.
6
+
7
+ ## [2.1.0](https://github.com/lostisland/faraday/compare/v2.0.1...v2.1.0) (2022-01-15)
8
+
9
+ * Fix test adapter thread safety by @iMacTia in [#1380](https://github.com/lostisland/faraday/pull/1380)
10
+ * Add default adapter options by @hirasawayuki in [#1382](https://github.com/lostisland/faraday/pull/1382)
11
+ * CI: Add Ruby 3.1 to matrix by @petergoldstein in [#1374](https://github.com/lostisland/faraday/pull/1374)
12
+ * docs: fix regex pattern in logger.md examples by @hirasawayuki in [#1378](https://github.com/lostisland/faraday/pull/1378)
13
+
14
+ ## [2.0.1](https://github.com/lostisland/faraday/compare/v2.0.0...v2.0.1) (2022-01-05)
15
+
16
+ * Re-add `faraday-net_http` as default adapter by @iMacTia in [#1366](https://github.com/lostisland/faraday/pull/1366)
17
+ * Updated sample format in UPGRADING.md by @vimutter in [#1361](https://github.com/lostisland/faraday/pull/1361)
18
+ * docs: Make UPGRADING examples more copyable by @olleolleolle in [#1363](https://github.com/lostisland/faraday/pull/1363)
19
+
20
+ ## [2.0.0](https://github.com/lostisland/faraday/compare/v1.8.0...v2.0.0) (2022-01-04)
21
+
22
+ The next major release is here, and it comes almost 2 years after the release of v1.0!
23
+
24
+ This release changes the way you use Faraday and embraces a new paradigm of Faraday as an ecosystem, rather than a library.
25
+
26
+ What does that mean? It means that Faraday is less of a bundled tool and more of a framework for the community to build on top of.
27
+
28
+ As a result, all adapters and some middleware have moved out and are now shipped as standalone gems 🙌!
29
+
30
+ But this doesn't mean that upgrading from Faraday 1.x to Faraday 2.0 should be hard, in fact we've listed everything you need to do in the [UPGRADING.md](https://github.com/lostisland/faraday/blob/main/UPGRADING.md) doc.
31
+
32
+ Moreover, we've setup a new [awesome-faraday](https://github.com/lostisland/awesome-faraday) repository that will showcase a curated list of adapters and middleware 😎.
33
+
34
+ This release was the result of the efforts of the core team and all the contributors, new and old, that have helped achieve this milestone 👏.
35
+
36
+ ## What's Changed
37
+
38
+ * Autoloading, dependency loading and middleware registry cleanup by @iMacTia in [#1301](https://github.com/lostisland/faraday/pull/1301)
39
+ * Move JSON middleware (request and response) from faraday_middleware by @iMacTia in [#1300](https://github.com/lostisland/faraday/pull/1300)
40
+ * Remove deprecated `Faraday::Request#method` by @olleolleolle in [#1303](https://github.com/lostisland/faraday/pull/1303)
41
+ * Remove deprecated `Faraday::UploadIO` by @iMacTia in [#1307](https://github.com/lostisland/faraday/pull/1307)
42
+ * [1.x] Deprecate Authorization helpers in `Faraday::Connection` by @iMacTia in [#1306](https://github.com/lostisland/faraday/pull/1306)
43
+ * Drop deprecated auth helpers from Connection and refactor auth middleware by @iMacTia in [#1308](https://github.com/lostisland/faraday/pull/1308)
44
+ * Add Faraday 1.x examples in authentication.md docs by @iMacTia in [#1320](https://github.com/lostisland/faraday/pull/1320)
45
+ * Fix passing a URL with embedded basic auth by @iMacTia in [#1324](https://github.com/lostisland/faraday/pull/1324)
46
+ * Register JSON middleware by @mollerhoj in [#1331](https://github.com/lostisland/faraday/pull/1331)
47
+ * Retry middleware should handle string exception class name consistently by @jrochkind in [#1334](https://github.com/lostisland/faraday/pull/1334)
48
+ * Improve request info in exceptions raised by RaiseError Middleware by @willianzocolau in [#1335](https://github.com/lostisland/faraday/pull/1335)
49
+ * Remove net-http adapter and update docs by @iMacTia in [#1336](https://github.com/lostisland/faraday/pull/1336)
50
+ * Explain plan for faraday_middleware in UPGRADING.md by @iMacTia in [#1339](https://github.com/lostisland/faraday/pull/1339)
51
+ * Scripts folder cleanup by @iMacTia in [#1340](https://github.com/lostisland/faraday/pull/1340)
52
+ * Replace `Hash#merge` with `Utils#deep_merge` for connection options by @xkwd in [#1343](https://github.com/lostisland/faraday/pull/1343)
53
+ * Callable authorizers by @sled in [#1345](https://github.com/lostisland/faraday/pull/1345)
54
+ * Default value for exc error by @DariuszMusielak in [#1351](https://github.com/lostisland/faraday/pull/1351)
55
+ * Don't call `retry_block` unless a retry is going to happen by @jrochkind in [#1350](https://github.com/lostisland/faraday/pull/1350)
56
+ * Improve documentation for v2 by @iMacTia in [#1353](https://github.com/lostisland/faraday/pull/1353)
57
+ * Remove default `default_adapter` (yes, you read that right) by @iMacTia in [#1354](https://github.com/lostisland/faraday/pull/1354)
58
+ * Remove retry middleware by @iMacTia in [#1356](https://github.com/lostisland/faraday/pull/1356)
59
+ * Remove multipart middleware and all its documentation and tests by @iMacTia in [#1357](https://github.com/lostisland/faraday/pull/1357)
60
+
61
+ ## [1.9.3](https://github.com/lostisland/faraday/compare/v1.9.2...v1.9.3) (2022-01-06)
62
+
63
+ * Re-add support for Ruby 2.4+ by @iMacTia in [#1371](https://github.com/lostisland/faraday/pull/1371)
64
+
65
+ ## [1.9.2](https://github.com/lostisland/faraday/compare/v1.9.1...v1.9.2) (2022-01-06)
66
+
67
+ * Add alias with legacy name to gemified middleware by @iMacTia in [#1372](https://github.com/lostisland/faraday/pull/1372)
68
+
69
+ ## [1.9.1](https://github.com/lostisland/faraday/compare/v1.9.0...v1.9.1) (2022-01-06)
70
+
71
+ * Update adapter dependencies in Gemspec by @iMacTia in [#1370](https://github.com/lostisland/faraday/pull/1370)
72
+
73
+ ## [1.9.0](https://github.com/lostisland/faraday/compare/v1.8.0...v1.9.0) (2022-01-06)
74
+
75
+ * Use external multipart and retry middleware by @iMacTia in [#1367](https://github.com/lostisland/faraday/pull/1367)
76
+
77
+ ## [1.8.0](https://github.com/lostisland/faraday/releases/tag/v1.8.0) (2021-09-18)
78
+
79
+ ### Features
80
+
81
+ * Backport authorization procs (#1322, @jarl-dk)
82
+
83
+ ## [v1.7.0](https://github.com/lostisland/faraday/releases/tag/v1.7.0) (2021-08-09)
84
+
85
+ ### Features
86
+
87
+ * Add strict_mode to Test::Stubs (#1298, @yykamei)
88
+
89
+ ## [v1.6.0](https://github.com/lostisland/faraday/releases/tag/v1.6.0) (2021-08-01)
90
+
91
+ ### Misc
92
+
93
+ * Use external Rack adapter (#1296, @iMacTia)
94
+
95
+ ## [v1.5.1](https://github.com/lostisland/faraday/releases/tag/v1.5.1) (2021-07-11)
96
+
97
+ ### Fixes
98
+
99
+ * Fix JRuby incompatibility after moving out EM adapters (#1294, @ahorek)
100
+
101
+ ### Documentation
102
+
103
+ * Update YARD to follow RackBuilder (#1292, @kachick)
104
+
105
+ ## [v1.5.0](https://github.com/lostisland/faraday/releases/tag/v1.5.0) (2021-07-04)
106
+
107
+ ### Misc
108
+
109
+ * Use external httpclient adapter (#1289, @iMacTia)
110
+ * Use external patron adapter (#1290, @iMacTia)
111
+
112
+ ## [v1.4.3](https://github.com/lostisland/faraday/releases/tag/v1.4.3) (2021-06-24)
113
+
114
+ ### Fixes
115
+
116
+ * Silence warning (#1286, @gurgeous)
117
+ * Always dup url_prefix in Connection#build_exclusive_url (#1288, @alexeyds)
118
+
119
+ ## [v1.4.2](https://github.com/lostisland/faraday/releases/tag/v1.4.2) (2021-05-22)
120
+
121
+ ### Fixes
122
+ * Add proxy setting when url_prefix is changed (#1276, @ci)
123
+ * Default proxy scheme to http:// if necessary, fixes #1282 (#1283, @gurgeous)
124
+
125
+ ### Documentation
126
+ * Improve introduction page (#1273, @gurgeous)
127
+ * Docs: add more middleware examples (#1277, @gurgeous)
128
+
129
+ ### Misc
130
+ * Use external `em_http` and `em_synchrony` adapters (#1274, @iMacTia)
131
+
132
+ ## [v1.4.1](https://github.com/lostisland/faraday/releases/tag/v1.4.1) (2021-04-18)
133
+
134
+ ### Fixes
135
+
136
+ * Fix dependencies from external adapter gems (#1269, @iMacTia)
137
+
138
+ ## [v1.4.0](https://github.com/lostisland/faraday/releases/tag/v1.4.0) (2021-04-16)
139
+
140
+ ### Highlights
141
+
142
+ With this release, we continue the work of gradually moving out adapters into their own gems 🎉
143
+ Thanks to @MikeRogers0 for helping the Faraday team in progressing with this quest 👏
144
+
145
+ And thanks to @olleolleolle efforts, Faraday is becoming more inclusive than ever 🤗
146
+ Faraday's `master` branch has been renamed into `main`, we have an official policy on inclusive language and even a rubocop plugin to check for non-inclusive words ❤️!
147
+ Checkout the "Misc" section below for more details 🙌 !
148
+
149
+ ### Fixes
150
+
151
+ * Fix NoMethodError undefined method 'coverage' (#1255, @Maroo-b)
152
+
153
+ ### Documentation
154
+
155
+ * Some docs on EventMachine adapters. (#1232, @damau)
156
+ * CONTRIBUTING: Fix grammar and layout (#1261, @olleolleolle)
157
+
158
+ ### Misc
159
+
160
+ * Replacing Net::HTTP::Persistent with faraday-net_http_persistent (#1250, @MikeRogers0)
161
+ * CI: Configure the regenerated Coveralls token (#1256, @olleolleolle)
162
+ * Replace Excon adapter with Faraday::Excon gem, and fix autoloading issue with Faraday::NetHttpPersistent (#1257, @iMacTia)
163
+ * Drop CodeClimate (#1259, @olleolleolle)
164
+ * CI: Rename default branch to main (#1263, @olleolleolle)
165
+ * Drop RDoc support file .document (#1264, @olleolleolle, @iMacTia)
166
+ * CONTRIBUTING: add a policy on inclusive language (#1262, @olleolleolle)
167
+ * Add rubocop-inclusivity (#1267, @olleolleolle, @iMacTia)
168
+
169
+ ## [v1.3.1](https://github.com/lostisland/faraday/releases/tag/v1.3.1) (2021-04-16)
170
+
171
+ ### Fixes
172
+
173
+ * Escape colon in path segment (#1237, @yarafan)
174
+ * Handle IPv6 address String on Faraday::Connection#proxy_from_env (#1252, @cosmo0920)
175
+
176
+ ### Documentation
177
+
178
+ * Fix broken Rubydoc.info links (#1236, @nickcampbell18)
179
+ * Add httpx to list of external adapters (#1246, @HoneyryderChuck)
180
+
181
+ ### Misc
182
+
183
+ * Refactor CI to remove duplicated line (#1230, @tricknotes)
184
+ * Gemspec: Pick a good ruby2_keywords release (#1241, @olleolleolle)
185
+
186
+ ## [v1.3.0](https://github.com/lostisland/faraday/releases/tag/v1.3.0) (2020-12-31)
187
+
188
+ ### Highlights
189
+ Faraday v1.3.0 is the first release to officially support Ruby 3.0 in the CI pipeline 🎉 🍾!
190
+
191
+ This is also the first release with a previously "included" adapter (Net::HTTP) being isolated into a [separate gem](https://github.com/lostisland/faraday-net_http) 🎊!
192
+ The new adapter is added to Faraday as a dependency for now, so that means full backwards-compatibility, but just to be safe be careful when upgrading!
193
+
194
+ This is a huge step towards are Faraday v2.0 objective of pushing adapters and middleware into separate gems.
195
+ Many thanks to the Faraday Team, @JanDintel and everyone who attended the [ROSS Conf remote event](https://www.rossconf.io/event/remote/)
196
+
197
+ ### Features
198
+
199
+ * Improves consistency with Faraday::Error and Faraday::RaiseError (#1229, @qsona, @iMacTia)
200
+
201
+ ### Fixes
202
+
203
+ * Don't assign to global ::Timer (#1227, @bpo)
204
+
205
+ ### Documentation
206
+
207
+ * CHANGELOG: add releases after 1.0 (#1225, @olleolleolle)
208
+ * Improves retry middleware documentation. (#1228, @iMacTia)
209
+
210
+ ### Misc
211
+
212
+ * Move out Net::HTTP adapter (#1222, @JanDintel, @iMacTia)
213
+ * Adds Ruby 3.0 to CI Matrix (#1226, @iMacTia)
214
+
215
+
216
+ ## [v1.2.0](https://github.com/lostisland/faraday/releases/tag/v1.2.0) (2020-12-23)
217
+
218
+ ### Features
219
+
220
+ * Introduces `on_request` and `on_complete` methods in `Faraday::Middleware`. (#1194, @iMacTia)
221
+
222
+ ### Fixes
223
+
224
+ * Require 'date' to avoid retry exception (#1206, @rustygeldmacher)
225
+ * Fix rdebug recursion issue (#1205, @native-api)
226
+ * Update call to `em_http_ssl_patch` (#1202, @kylekeesling)
227
+ * `EmHttp` adapter: drop superfluous loaded? check (#1213, @olleolleolle)
228
+ * Avoid 1 use of keyword hackery (#1211, @grosser)
229
+ * Fix #1219 `Net::HTTP` still uses env proxy (#1221, @iMacTia)
230
+
231
+ ### Documentation
232
+
233
+ * Add comment in gemspec to explain exposure of `examples` and `spec` folders. (#1192, @iMacTia)
234
+ * Adapters, how to create them (#1193, @olleolleolle)
235
+ * Update documentation on using the logger (#1196, @tijmenb)
236
+ * Adjust the retry documentation and spec to align with implementation (#1198, @nbeyer)
237
+
238
+ ### Misc
239
+
240
+ * Test against ruby head (#1208, @grosser)
241
+
242
+ ## [v1.1.0](https://github.com/lostisland/faraday/releases/tag/v1.1.0) (2020-10-17)
243
+
244
+ ### Features
245
+
246
+ * Makes parameters sorting configurable (#1162 @wishdev)
247
+ * Introduces `flat_encode` option for multipart adapter. (#1163 @iMacTia)
248
+ * Include request info in exceptions raised by RaiseError Middleware (#1181 @SandroDamilano)
249
+
250
+ ### Fixes
251
+
252
+ * Avoid `last arg as keyword param` warning when building user middleware on Ruby 2.7 (#1153 @dgholz)
253
+ * Limits net-http-persistent version to < 4.0 (#1156 @iMacTia)
254
+ * Update `typhoeus` to new stable version (`1.4`) (#1159 @AlexWayfer)
255
+ * Properly fix test failure with Rack 2.1+. (#1171 @voxik)
256
+
257
+ ### Documentation
258
+
259
+ * Improves documentation on how to contribute to the site by using Docker. (#1175 @iMacTia)
260
+ * Remove retry_change_requests from documentation (#1185 @stim371)
261
+
262
+ ### Misc
263
+
264
+ * Link from GitHub Actions badge to CI workflow (#1141 @olleolleolle)
265
+ * Return tests of `Test` adapter (#1147 @AlexWayfer)
266
+ * Add 1.0 release to wording in CONTRIBUTING (#1155 @olleolleolle)
267
+ * Fix linting bumping Rubocop to 0.90.0 (#1182 @iMacTia)
268
+ * Drop `git ls-files` in gemspec (#1183 @utkarsh2102)
269
+ * Upgrade CI to ruby/setup-ruby (#1187 @gogainda)
270
+
271
+ ## [v1.0.1](https://github.com/lostisland/faraday/releases/tag/v1.0.1) (2020-03-29)
272
+
273
+ ### Fixes
274
+
275
+ * Use Net::HTTP#start(&block) to ensure closed TCP connections (#1117)
276
+ * Fully qualify constants to be checked (#1122)
277
+ * Allows `parse` method to be private/protected in response middleware (#1123)
278
+ * Encode Spaces in Query Strings as '%20' Instead of '+' (#1125)
279
+ * Limits rack to v2.0.x (#1127)
280
+ * Adapter Registry reads also use mutex (#1136)
281
+
282
+ ### Documentation
283
+
284
+ * Retry middleware documentation fix (#1109)
285
+ * Docs(retry): precise usage of retry-after (#1111)
286
+ * README: Link the logo to the website (#1112)
287
+ * Website: add search bar (#1116)
288
+ * Fix request/response mix-up in docs text (#1132)
289
+
290
+ ## [v1.0](https://github.com/lostisland/faraday/releases/tag/v1.0.0) (2020-01-22)
291
+
292
+ Features:
293
+
294
+ * Add #trace support to Faraday::Connection #861 (@technoweenie)
295
+ * Add the log formatter that is easy to override and safe to inherit #889 (@prikha)
296
+ * Support standalone adapters #941 (@iMacTia)
297
+ * Introduce Faraday::ConflictError for 409 response code #979 (@lucasmoreno)
298
+ * Add support for setting `read_timeout` option separately #1003 (@springerigor)
299
+ * Refactor and cleanup timeout settings across adapters #1022 (@technoweenie)
300
+ * Create ParamPart class to allow multipart posts with JSON content and file upload at the same time #1017 (@jeremy-israel)
301
+ * Copy UploadIO const -> FilePart for consistency with ParamPart #1018, #1021 (@technoweenie)
302
+ * Implement streaming responses in the Excon adapter #1026 (@technoweenie)
303
+ * Add default implementation of `Middleware#close`. #1069 (@ioquatix)
304
+ * Add `Adapter#close` so that derived classes can call super. #1091 (@ioquatix)
305
+ * Add log_level option to logger default formatter #1079 (@amrrbakry)
306
+ * Fix empty array for FlatParamsEncoder `{key: []} -> "key="` #1084 (@mrexox)
307
+
308
+ Bugs:
309
+
310
+ * Explicitly require date for DateTime library in Retry middleware #844 (@nickpresta)
311
+ * Refactor Adapter as final endpoints #846 (@iMacTia)
312
+ * Separate Request and Response bodies in Faraday::Env #847 (@iMacTia)
313
+ * Implement Faraday::Connection#options to make HTTP requests with the OPTIONS verb. #857 (@technoweenie)
314
+ * Multipart: Drop Ruby 1.8 String behavior compat #892 (@olleolleolle)
315
+ * Fix Ruby warnings in Faraday::Options.memoized #962 (@technoweenie)
316
+ * Allow setting min/max SSL version for a Net::HTTP::Persistent connection #972, #973 (@bdewater, @olleolleolle)
317
+ * Fix instances of frozen empty string literals #1040 (@BobbyMcWho)
318
+ * remove temp_proxy and improve proxy tests #1063 (@technoweenie)
319
+ * improve error initializer consistency #1095 (@technoweenie)
320
+
321
+ Misc:
322
+
323
+ * Convert minitest suite to RSpec #832 (@iMacTia, with help from @gaynetdinov, @Insti, @technoweenie)
324
+ * Major effort to update code to RuboCop standards. #854 (@olleolleolle, @iMacTia, @technoweenie, @htwroclau, @jherdman, @Drenmi, @Insti)
325
+ * Rubocop #1044, #1047 (@BobbyMcWho, @olleolleolle)
326
+ * Documentation tweaks (@adsteel, @Hubro, @iMacTia, @olleolleolle, @technoweenie)
327
+ * Update license year #981 (@Kevin-Kawai)
328
+ * Configure Jekyll plugin jekyll-remote-theme to support Docker usage #999 (@Lewiscowles1986)
329
+ * Fix Ruby 2.7 warnings #1009 (@tenderlove)
330
+ * Cleanup adapter connections #1023 (@technoweenie)
331
+ * Describe clearing cached stubs #1045 (@viraptor)
332
+ * Add project metadata to the gemspec #1046 (@orien)
333
+
334
+ ## v0.17.4
335
+
336
+ Fixes:
337
+
338
+ * NetHttp adapter: wrap Errno::EADDRNOTAVAIL (#1114, @embs)
339
+ * Fix === for subclasses of deprecated classes (#1243, @mervync)
340
+
341
+ ## v0.17.3
342
+
343
+ Fixes:
344
+
345
+ * Reverts changes in error classes hierarchy. #1092 (@iMacTia)
346
+ * Fix Ruby 1.9 syntax errors and improve Error class testing #1094 (@BanzaiMan,
347
+ @mrexox, @technoweenie)
348
+
349
+ Misc:
350
+
351
+ * Stops using `&Proc.new` for block forwarding. #1083 (@olleolleolle)
352
+ * Update CI to test against ruby 2.0-2.7 #1087, #1099 (@iMacTia, @olleolleolle,
353
+ @technoweenie)
354
+ * require FARADAY_DEPRECATE=warn to show Faraday v1.0 deprecation warnings
355
+ #1098 (@technoweenie)
356
+
357
+ ## v0.17.1
358
+
359
+ Final release before Faraday v1.0, with important fixes for Ruby 2.7.
360
+
361
+ Fixes:
362
+
363
+ * RaiseError response middleware raises exception if HTTP client returns a nil
364
+ status. #1042 (@jonnyom, @BobbyMcWho)
365
+
366
+ Misc:
367
+
368
+ * Fix Ruby 2.7 warnings (#1009)
369
+ * Add `Faraday::Deprecate` to warn about upcoming v1.0 changes. (#1054, #1059,
370
+ #1076, #1077)
371
+ * Add release notes up to current in CHANGELOG.md (#1066)
372
+ * Port minimal rspec suite from main branch to run backported tests. (#1058)
373
+
374
+ ## v0.17.0
375
+
376
+ This release is the same as v0.15.4. It was pushed to cover up releases
377
+ v0.16.0-v0.16.2.
378
+
379
+ ## v0.15.4
380
+
381
+ * Expose `pool_size` as a option for the NetHttpPersistent adapter (#834)
382
+
383
+ ## v0.15.3
384
+
385
+ * Make Faraday::Request serialisable with Marshal. (#803)
386
+ * Add DEFAULT_EXCEPTIONS constant to Request::Retry (#814)
387
+ * Add support for Ruby 2.6 Net::HTTP write_timeout (#824)
388
+
389
+ ## v0.15.2
390
+
391
+ * Prevents `Net::HTTP` adapters to retry request internally by setting `max_retries` to 0 if available (Ruby 2.5+). (#799)
392
+ * Fixes `NestedParamsEncoder` handling of empty array values (#801)
393
+
394
+ ## v0.15.1
395
+
396
+ * NetHttpPersistent adapter better reuse of SSL connections (#793)
397
+ * Refactor: inline cached_connection (#797)
398
+ * Logger middleware: use $stdout instead of STDOUT (#794)
399
+ * Fix: do not memoize/reuse Patron session (#796)
400
+
401
+ Also in this release:
402
+
403
+ * Allow setting min/max ssl version for Net::HTTP (#792)
404
+ * Allow setting min/max ssl version for Excon (#795)
405
+
406
+ ## v0.15.0
407
+
408
+ Features:
409
+
410
+ * Added retry block option to retry middleware. (#770)
411
+ * Retry middleware improvements (honour Retry-After header, retry statuses) (#773)
412
+ * Improve response logger middleware output (#784)
413
+
414
+ Fixes:
415
+
416
+ * Remove unused class error (#767)
417
+ * Fix minor typo in README (#760)
418
+ * Reuse persistent connections when using net-http-persistent (#778)
419
+ * Fix Retry middleware documentation (#781)
420
+ * Returns the http response when giving up on retrying by status (#783)
421
+
422
+ ## v0.14.0
423
+
424
+ Features:
425
+
426
+ * Allow overriding env proxy #754 (@iMacTia)
427
+ * Remove legacy Typhoeus adapter #715 (@olleolleolle)
428
+ * External Typhoeus Adapter Compatibility #748 (@iMacTia)
429
+ * Warn about missing adapter when making a request #743 (@antstorm)
430
+ * Faraday::Adapter::Test stubs now support entire urls (with host) #741 (@erik-escobedo)
431
+
432
+ Fixes:
433
+
434
+ * If proxy is manually provided, this takes priority over `find_proxy` #724 (@iMacTia)
435
+ * Fixes the behaviour for Excon's open_timeout (not setting write_timeout anymore) #731 (@apachelogger)
436
+ * Handle all connection timeout messages in Patron #687 (@stayhero)
437
+
438
+ ## v0.13.1
439
+
440
+ * Fixes an incompatibility with Addressable::URI being used as uri_parser
441
+
442
+ ## v0.13.0
443
+
444
+ Features:
445
+
446
+ * Dynamically reloads the proxy when performing a request on an absolute domain (#701)
447
+ * Adapter support for Net::HTTP::Persistent v3.0.0 (#619)
448
+
449
+ Fixes:
450
+
451
+ * Prefer #hostname over #host. (#714)
452
+ * Fixes an edge-case issue with response headers parsing (missing HTTP header) (#719)
453
+
454
+ ## v0.12.2
455
+
456
+ * Parse headers from aggregated proxy requests/responses (#681)
457
+ * Guard against invalid middleware configuration with warning (#685)
458
+ * Do not use :insecure option by default in Patron (#691)
459
+ * Fixes an issue with HTTPClient not raising a `Faraday::ConnectionFailed` (#702)
460
+ * Fixes YAML serialization/deserialization for `Faraday::Utils::Headers` (#690)
461
+ * Fixes an issue with Options having a nil value (#694)
462
+ * Fixes an issue with Faraday.default_connection not using Faraday.default_connection_options (#698)
463
+ * Fixes an issue with Options.merge! and Faraday instrumentation middleware (#710)
464
+
465
+ ## v0.12.1
466
+
467
+ * Fix an issue with Patron tests failing on jruby
468
+ * Fix an issue with new `rewind_files` feature that was causing an exception when the body was not an Hash
469
+ * Expose wrapped_exception in all client errors
470
+ * Add Authentication Section to the ReadMe
471
+
472
+ ## v0.12.0.1
473
+
474
+ * Hotfix release to address an issue with TravisCI deploy on Rubygems
475
+
476
+ ## v0.12.0
477
+
478
+ Features:
479
+
480
+ * Proxy feature now relies on Ruby `URI::Generic#find_proxy` and can use `no_proxy` ENV variable (not compatible with ruby < 2.0)
481
+ * Adds support for `context` request option to pass arbitrary information to middlewares
482
+
483
+ Fixes:
484
+
485
+ * Fix an issue with options that was causing new options to override defaults ones unexpectedly
486
+ * Rewind `UploadIO`s on retry to fix a compatibility issue
487
+ * Make multipart boundary unique
488
+ * Improvements in `README.md`
489
+
490
+ ## v0.11.0
491
+
492
+ Features:
493
+
494
+ * Add `filter` method to Logger middleware
495
+ * Add support for Ruby2.4 and Minitest 6
496
+ * Introduce block syntax to customise the adapter
497
+
498
+ Fixes:
499
+
500
+ * Fix an issue that was allowing to override `default_connection_options` from a connection instance
501
+ * Fix a bug that was causing newline escape characters ("\n") to be used when building the Authorization header
502
+
503
+ ## v0.10.1
504
+
505
+ - Fix an issue with HTTPClient adapter that was causing the SSL to be reset on every request
506
+ - Rescue `IOError` instead of specific subclass
507
+ - `Faraday::Utils::Headers` can now be successfully serialised in YAML
508
+ - Handle `default_connection_options` set with hash
509
+
510
+ ## v0.10.0
511
+
512
+ Breaking changes:
513
+ - Drop support for Ruby 1.8
514
+
515
+ Features:
516
+ - Include wrapped exception/reponse in ClientErrors
517
+ - Add `response.reason_phrase`
518
+ - Provide option to selectively skip logging request/response headers
519
+ - Add regex support for pattern matching in `test` adapter
520
+
521
+ Fixes:
522
+ - Add `Faraday.respond_to?` to find methods managed by `method_missing`
523
+ - em-http: `request.host` instead of `connection.host` should be taken for SSL validations
524
+ - Allow `default_connection_options` to be merged when options are passed as url parameter
525
+ - Improve splitting key-value pairs in raw HTTP headers
526
+
527
+ ## v0.9.2
528
+
529
+ Adapters:
530
+ - Enable gzip compression for httpclient
531
+ - Fixes default certificate store for httpclient not having default paths.
532
+ - Make excon adapter compatible with 0.44 excon version
533
+ - Add compatibility with Patron 0.4.20
534
+ - Determine default port numbers in Net::HTTP adapters (Addressable compatibility)
535
+ - em-http: wrap "connection closed by server" as ConnectionFailed type
536
+ - Wrap Errno::ETIMEDOUT in Faraday::Error::TimeoutError
537
+
538
+ Utils:
539
+ - Add Rack-compatible support for parsing `a[][b]=c` nested queries
540
+ - Encode nil values in queries different than empty strings. Before: `a=`; now: `a`.
541
+ - Have `Faraday::Utils::Headers#replace` clear internal key cache
542
+ - Dup the internal key cache when a Headers hash is copied
543
+
544
+ Env and middleware:
545
+ - Ensure `env` stored on middleware response has reference to the response
546
+ - Ensure that Response properties are initialized during `on_complete` (VCR compatibility)
547
+ - Copy request options in Faraday::Connection#dup
548
+ - Env custom members should be copied by Env.from(env)
549
+ - Honour per-request `request.options.params_encoder`
550
+ - Fix `interval_randomness` data type for Retry middleware
551
+ - Add maximum interval option for Retry middleware
552
+
553
+ ## v0.9.1
554
+
555
+ * Refactor Net:HTTP adapter so that with_net_http_connection can be overridden to allow pooled connections. (@Ben-M)
556
+ * Add configurable methods that bypass `retry_if` in the Retry request middleware. (@mike-bourgeous)
557
+
558
+ ## v0.9.0
559
+
560
+ * Add HTTPClient adapter (@hakanensari)
561
+ * Improve Retry handler (@mislav)
562
+ * Remove autoloading by default (@technoweenie)
563
+ * Improve internal docs (@technoweenie, @mislav)
564
+ * Respect user/password in http proxy string (@mislav)
565
+ * Adapter options are structs. Reinforces consistent options across adapters
566
+ (@technoweenie)
567
+ * Stop stripping trailing / off base URLs in a Faraday::Connection. (@technoweenie)
568
+ * Add a configurable URI parser. (@technoweenie)
569
+ * Remove need to manually autoload when using the authorization header helpers on `Faraday::Connection`. (@technoweenie)
570
+ * `Faraday::Adapter::Test` respects the `Faraday::RequestOptions#params_encoder` option. (@technoweenie)
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2017 Rick Olson, Zack Hobson
1
+ Copyright (c) 2009-2020 Rick Olson, Zack Hobson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the