/** * Generates the headers to be send with the request. * * @return array Array of HTTP headers. */ public function getHeaders() { $headers = $this->header; $headers[] = TYPO3_user_agent; $itemId = $this->indexQueueItem->getIndexQueueUid(); $pageId = $this->indexQueueItem->getRecordPageId(); $indexerRequestData = array('requestId' => $this->requestId, 'item' => $itemId, 'page' => $pageId, 'actions' => implode(',', $this->actions), 'hash' => md5($itemId . '|' . $pageId . '|' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])); $indexerRequestData = array_merge($indexerRequestData, $this->parameters); $headers[] = 'X-Tx-Solr-Iq: ' . json_encode($indexerRequestData); if (!empty($this->username) && !empty($this->password)) { $headers[] = 'Authorization: Basic ' . base64_encode($this->username . ':' . $this->password); } return $headers; }