protected function sendBody(ResponseInterface $response) { if ($response->getBody() !== null) { $transferEncoding = $response->getHeader('Transfer-Encoding'); $contentEncoding = $response->getHeader('Content-Encoding'); if ($transferEncoding == 'chunked') { $this->sendContentChunked($response); } else { $this->sendContentEncoded($contentEncoding, $response); } } }
/** * Returns an array containing all headers which gets saved in the cache * * @param \PSX\Http\ResponseInterface $response * @return array */ protected function getCacheHeaders(ResponseInterface $response) { $headers = array('Last-Modified' => date(DateTime::HTTP)); if ($response->hasHeader('Content-Type')) { $headers['Content-Type'] = $response->getHeader('Content-Type'); } return $headers; }