protected function matchHost($host)
    {
        if (empty($this->host)) {
            return true;
        }

        $host = preg_replace('/^[^:]+:\/\//i', '', $host);
        $regex = str_replace('\{basename\}', '.*', preg_quote($this->host));

        return preg_match('/^' . $regex . '$/i', $host);
    }