class HTTParty::Request

def uri

def uri
  if redirect && path.relative? && path.path[0] != '/'
    last_uri_host = @last_uri.path.gsub(/[^\/]+$/, '')
    path.path = "/#{path.path}" if last_uri_host[-1] != '/'
    path.path = "#{last_uri_host}#{path.path}"
  end
  if path.relative? && path.host
    new_uri = options[:uri_adapter].parse("#{@last_uri.scheme}:#{path}").normalize
  elsif path.relative?
    new_uri = options[:uri_adapter].parse("#{base_uri}#{path}").normalize
  else
    new_uri = path.clone
  end
  # avoid double query string on redirects [#12]
  unless redirect
    new_uri.query = query_string(new_uri)
  end
  unless SupportedURISchemes.include? new_uri.scheme
    raise UnsupportedURIScheme, "'#{new_uri}' Must be HTTP, HTTPS or Generic"
  end
  @last_uri = new_uri
end