public function getHeaderProxy()
    {
        if ($this->isTestMode) {
            $className = \Tx_Oelib_HeaderCollector::class;
        } else {
            $className = \Tx_Oelib_RealHeaderProxy::class;
        }

        if (!is_object($this->headerProxy) || (get_class($this->headerProxy) !== $className)) {
            $this->headerProxy = GeneralUtility::makeInstance($className);
        }

        return $this->headerProxy;
    }