discover_uri (OpenID)

    # File lib/openid/consumer/discovery.rb, line 458
      def self.discover_uri(uri)
        # Hack to work around URI parsing for URls with *no* scheme.
        if uri.index("://").nil?
          uri = 'http://' + uri
        end

        begin
          parsed = URI::parse(uri)
        rescue URI::InvalidURIError => why
          raise DiscoveryFailure.new("URI is not valid: #{why.message}", nil)
        end

        if !parsed.scheme.nil? and !parsed.scheme.empty?
          if !['http', 'https'].member?(parsed.scheme)
            raise DiscoveryFailure.new(
                    "URI scheme #{parsed.scheme} is not HTTP or HTTPS", nil)
          end
        end

        uri = self.normalize_url(uri)
        claimed_id, openid_services = self.discover_yadis(uri)
        claimed_id = self.normalize_url(claimed_id)
        return [claimed_id, openid_services]
      end