public function getLocalReferer()
    {
        $request = $this->getRequest();
        $referer = $request->getHeaderLine('HTTP_REFERER');
        $host = $request->getHeaderLine('HTTP_HOST');

        return $referer && parse_url($referer, PHP_URL_HOST) === $host ? $referer : '';
    }