Skip to content

Commit

Permalink
[HttpKernel] Allow any 2xx response code in a subrequest
Browse files Browse the repository at this point in the history
  • Loading branch information
igorw authored and fabpot committed Feb 10, 2011
1 parent 8cb3a23 commit e929bc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/HttpCache/Esi.php
Expand Up @@ -179,7 +179,7 @@ public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors)
try {
$response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);

if (200 != $response->getStatusCode()) {
if (!$response->isSuccessful()) {
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $subRequest->getUri(), $response->getStatusCode()));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/bootstrap_cache.php
Expand Up @@ -1028,7 +1028,7 @@ public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors)
$subRequest = Request::create($uri, 'get', array(), $cache->getRequest()->cookies->all(), array(), $cache->getRequest()->server->all());
try {
$response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
if (200 != $response->getStatusCode()) {
if (!$response->isSuccessful()) {
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $subRequest->getUri(), $response->getStatusCode()));
}
return $response->getContent();
Expand Down

0 comments on commit e929bc5

Please sign in to comment.