# File lib/em-http/http_client_options.rb, line 31 def set_uri(uri) uri = uri.kind_of?(Addressable::URI) ? uri : Addressable::URI::parse(uri.to_s) uri.path = '/' if uri.path.empty? uri.path = @path if @path @uri = uri # Make sure the ports are set as Addressable::URI doesn't # set the port if it isn't there if @uri.scheme == "https" @uri.port ||= 443 else @uri.port ||= 80 end @host = @uri.host @port = @uri.port end