protected function getHostRole(GetResponseEvent $event)
    {
        $hostRole = null;
        $hostname = $event->getRequest()->getHttpHost();

        foreach ($this->config as $hostPattern => $role) {
            if ($this->isValid($hostPattern, $hostname)) {
                $hostRole = $role;

                break;
            }
        }

        return $hostRole;
    }