Kohana v3.3.2

This commit is contained in:
Deon George
2014-09-06 23:43:07 +10:00
parent f96694b18f
commit 8888719653
236 changed files with 1685 additions and 996 deletions

View File

@@ -105,8 +105,8 @@ abstract class Kohana_Request_Client {
':depth' => $this->callback_depth() - 1,
));
// Execute the request
$orig_response = $response = Response::factory();
// Execute the request and pass the currently used protocol
$orig_response = $response = Response::factory(array('_protocol' => $request->protocol()));
if (($cache = $this->cache()) instanceof HTTP_Cache)
return $cache->execute($this, $request, $response);
@@ -405,10 +405,13 @@ abstract class Kohana_Request_Client {
break;
}
// Prepare the additional request
// Prepare the additional request, copying any follow_headers that were present on the original request
$orig_headers = $request->headers()->getArrayCopy();
$follow_headers = array_intersect_assoc($orig_headers, array_fill_keys($client->follow_headers(), TRUE));
$follow_request = Request::factory($response->headers('Location'))
->method($follow_method)
->headers(Arr::extract($request->headers(), $client->follow_headers()));
->headers($follow_headers);
if ($follow_method !== Request::GET)
{
@@ -421,4 +424,4 @@ abstract class Kohana_Request_Client {
return NULL;
}
}
}