lib/grenache/http.rb in grenache-ruby-http-0.2.17 vs lib/grenache/http.rb in grenache-ruby-http-0.2.18

- old
+ new

@@ -101,15 +101,12 @@ @http_client ||= HttpClient.new(config) end def get_random_service services service = services.sample - service.sub!("tcp://","https://") - if tls? - service.prepend("https://") unless service.start_with?("https://") - else - service.prepend("http://") unless service.start_with?("http://") - end + proto = tls? ? 'https://' : 'http://' + service = service.sub('tcp://', proto) + service.prepend(proto) unless service.start_with?(proto) service end end end