Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow configuring Faraday adapter with configure_connection block #683

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

doryphores
Copy link

Fixes

A small change to Twilio::HTTP::Client to allow us to configure the Faraday adapter with configure_connection.

For example:

client = Twilio::REST::Client.new(account_sid, auth_token)

client.http_client.configure_connection do |faraday|
  faraday.adapter :typhoeus, verbose: true
end

Without this change, the above configuration would be ignored because the adapter is reset after the configure connection blocks are applied.

And we cannot pass params to the adapter with the adapter accessor on the client instance:

client = Twilio::REST::Client.new(account_sid, auth_token)

# here, we cannot configure the typhoeus adapter with verbose: true
client.http_client.adapter = :typhoeus

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

@doryphores doryphores force-pushed the allow-configuring-faraday-adapter branch from b7b02bf to 496a1cf Compare October 10, 2023 09:30
@doryphores doryphores force-pushed the allow-configuring-faraday-adapter branch from 496a1cf to a821e31 Compare November 15, 2023 11:16
Setting the adapter after calling the configure_connection blocks makes
it impossible to configure the adapter with options.
@doryphores doryphores force-pushed the allow-configuring-faraday-adapter branch from a821e31 to 143d7bb Compare April 4, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant