public function isSelfDomain($throw = false)
    {
        if (!$domains = $this->allowDomains) {
            return true;
        }

        if (!in_array(strtolower($_SERVER['SERVER_NAME']), $domains, true) ||
            !in_array(strtolower($_SERVER['HTTP_HOST']), $domains, true)
        ) {
            if ($throw === true) {
                throw new RequestException("Invalid domain: {$_SERVER['HTTP_HOST']}");
            } else {
                if (class_exists('\rock\log\Log')) {
                    $message = BaseException::convertExceptionToString(new RequestException("Invalid domain: {$_SERVER['HTTP_HOST']}"));
                    Log::err($message);
                }
            }

            return false;
        }

        return true;
    }