Upgrade Faraday lib to 2.9.0#36
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades the Faraday HTTP client library from version 1.10 to 2.9.0, modernizing the gem's HTTP handling capabilities. The upgrade requires significant changes to adapt to Faraday v2's breaking changes, including new middleware structure and API modifications.
Key changes:
- Updated Faraday dependency from ~> 1.10 to >= 2.9.0, < 3.0
- Replaced deprecated faraday_middleware with separate faraday-multipart and faraday-retry gems
- Refactored authentication and connection setup to use Faraday v2 APIs
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| incognia_api.gemspec | Updates Faraday dependency to v2.9.0 and adds new middleware gems |
| lib/incognia_api/client.rb | Refactors HTTP client to use Faraday v2 APIs with manual auth header construction |
| lib/incognia_api/api.rb | Updates require statements to use new Faraday middleware gems |
| fixtures/vcr_cassettes/token.yml | Updates test fixtures to reflect new Faraday version in User-Agent headers |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| r.body = { | ||
| client_id: Incognia.config.client_id, | ||
| client_secret: Incognia.config.client_secret, | ||
| grant_type: "client_credentials" | ||
| } |
There was a problem hiding this comment.
Setting r.body to a hash will not work correctly with the URL-encoded content type. The body should be URL-encoded string format or use Faraday's form encoding. Consider using URI.encode_www_form or let Faraday handle the encoding by using the :url_encoded request middleware properly.
e49317d to
9f8311a
Compare
9f8311a to
9d40f30
Compare
|
Closing as this is already being addressed in: #37 |
No description provided.