Beispiel #1
0
 /**
  * Update a cached request, using the headers from the last response.
  * @param HttpRequest $cached A previously cached response.
  * @param mixed Associative array of response headers from the last request.
  */
 protected function updateCachedRequest($cached, $responseHeaders)
 {
     if (isset($responseHeaders['connection'])) {
         $hopByHop = array_merge(self::$HOP_BY_HOP, explode(',', $responseHeaders['connection']));
         $endToEnd = array();
         foreach ($hopByHop as $key) {
             if (isset($responseHeaders[$key])) {
                 $endToEnd[$key] = $responseHeaders[$key];
             }
         }
         $cached->setResponseHeaders($endToEnd);
     }
 }