protected function filtering(
        RouteInterface $route,
        RequestInterface $request
    ) {
        foreach ($route->getFilters() as $field => $filter) {
            list($grpName, $keyName) = explode('.', $field, 2);
            switch ($grpName) {
                case 'session':
                    $against = isset($_SESSION[$keyName]) ?
                        $_SESSION[$keyName] : '';
                    break;
                case 'cookie':
                    $against = isset($_COOKIE[$keyName]) ?
                        $_COOKIE[$keyName] : '';
                    break;
                case 'request':
                    $against = $request->getRequestInfo($keyName);
                    break;
                default:
                    $against = $request->getServerInfo($keyName);
                    break;
            }

            if (is_callable($filter)) {
                return $filter((string) $against);
            } elseif (!preg_match('~'.$filter.'~x', (string) $against)) {
                return false;
            }
        }
        return true;
    }