lib/hyper_resource/modules/http.rb in hyperresource-0.2.1 vs lib/hyper_resource/modules/http.rb in hyperresource-0.2.2
- old
+ new
@@ -68,10 +68,10 @@
def faraday_connection(url=nil)
url ||= URI.join(self.root, self.href)
key = "faraday_connection_#{url}"
return Thread.current[key] if Thread.current[key]
- fc = Faraday.new(:url => url)
+ fc = Faraday.new(self.faraday_options.merge(:url => url))
fc.headers.merge!('User-Agent' => "HyperResource #{HyperResource::VERSION}")
fc.headers.merge!(self.headers || {})
if ba=self.auth[:basic]
fc.basic_auth(*ba)
end