lib/ridley/connection.rb in ridley-0.8.1 vs lib/ridley/connection.rb in ridley-0.8.2
- old
+ new
@@ -58,25 +58,19 @@
b.adapter :net_http_persistent
end
uri_hash = Addressable::URI.parse(server_url).to_hash.slice(:scheme, :host, :port)
-
unless uri_hash[:port]
uri_hash[:port] = (uri_hash[:scheme] == "https" ? 443 : 80)
end
if org_match = server_url.match(/.*\/organizations\/(.*)/)
@organization = org_match[1]
end
- unless @organization.nil?
- uri_hash[:path] = "/organizations/#{@organization}"
- end
-
- server_uri = Addressable::URI.new(uri_hash)
-
- super(server_uri, options)
+ super(Addressable::URI.new(uri_hash), options)
+ @headers[:user_agent] = "Ridley v#{Ridley::VERSION}"
end
# @return [Symbol]
def api_type
organization.nil? ? :foss : :hosted