protected function isAjax() : bool 
    {
        $header = $this->request->getHeaders()->get('X-Requested-With');

        if ($header === null) {
            return false;
        }
        
        return $header->getValue() === 'XMLHttpRequest';
    }