class Addressable::URI

def normalized_userinfo

Returns:
  • (String) - The userinfo component, normalized.
def normalized_userinfo
  return nil unless self.userinfo
  return @normalized_userinfo unless @normalized_userinfo == NONE
  @normalized_userinfo = begin
    current_user = self.normalized_user
    current_password = self.normalized_password
    if !current_user && !current_password
      nil
    elsif current_user && current_password
      "#{current_user}:#{current_password}".dup
    elsif current_user && !current_password
      "#{current_user}".dup
    end
  end
  # All normalized values should be UTF-8
  force_utf8_encoding_if_needed(@normalized_userinfo)
  @normalized_userinfo
end