method

update_uri

Importance_0
v2_1_10 - Show latest stable - 0 notes - Class: Net::HTTPGenericRequest
update_uri(host, port, ssl) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/net/http/generic_request.rb, line 140
  def update_uri(host, port, ssl) # :nodoc: internal use only
    return unless @uri

    @uri.host ||= host
    @uri.port = port

    scheme = ssl ? 'https' : 'http'

    # convert the class of the URI
    unless scheme == @uri.scheme then
      new_uri = @uri.to_s.sub(/^https?/, scheme)
      @uri = URI new_uri
    end

    @uri
  end
Register or log in to add new notes.