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

Do not set the adapter on faraday prior the request #149

Merged
merged 3 commits into from
Jul 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/diplomat/rest_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ def start_connection(api_connection = nil)

def build_connection(api_connection, raise_error = false)
api_connection || Faraday.new(Diplomat.configuration.url, Diplomat.configuration.options) do |faraday|
faraday.adapter Faraday.default_adapter
faraday.request :url_encoded
faraday.response :raise_error unless raise_error

Diplomat.configuration.middleware.each do |middleware|
faraday.use middleware
end

faraday.request :url_encoded
faraday.response :raise_error unless raise_error

faraday.adapter Faraday.default_adapter
end
end

Expand Down