Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor Ahora::Resource#connection

  • Loading branch information...
commit e711d707fb042ac6ca6cc3c13a05b7c7549243dd 1 parent 8e49769
@mlangenberg authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/ahora/resource.rb
View
8 lib/ahora/resource.rb
@@ -27,14 +27,14 @@ def put(url, body)
end
def connection
- conn = Faraday.new(host, :ssl => { :verify => false }) do |builder|
+ Faraday.new(host, :ssl => { :verify => false }) do |builder|
builder.use Faraday::Response::RaiseError
extend_middleware(builder)
builder.adapter Faraday.default_adapter
+ end.tap do |conn|
+ set_common_headers(conn.headers)
+ conn.headers.merge!(headers)
end
- set_common_headers(conn.headers)
- conn.headers.merge!(headers)
- conn
end
# @abstract override to use custom Faraday middleware
Please sign in to comment.
Something went wrong with that request. Please try again.