# File lib/openid/message.rb, line 318
    def _fix_ns(namespace)
      if namespace == OPENID_NS
        unless @openid_ns_uri
          raise UndefinedOpenIDNamespace, 'OpenID namespace not set'
        else
          namespace = @openid_ns_uri
        end
      end

      if namespace == BARE_NS
        return namespace
      end

      if !namespace.is_a?(String)
        raise ArgumentError, ("Namespace must be BARE_NS, OPENID_NS or "\
                              "a string. Got #{namespace.inspect}")
      end

      if namespace.index(':').nil?
        msg = ("OpenID 2.0 namespace identifiers SHOULD be URIs. "\
               "Got #{namespace.inspect}")
        Util.log(msg)

        if namespace == 'sreg'
          msg = "Using #{SREG_URI} instead of \"sreg\" as namespace"
          Util.log(msg)
          return SREG_URI
        end
      end

      return namespace
    end