[HttpKernel] Allow any 2xx response code in a subrequest
This commit is contained in:
parent
8cb3a237cc
commit
e929bc5d1b
@ -179,7 +179,7 @@ class Esi
|
|||||||
try {
|
try {
|
||||||
$response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
|
$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()));
|
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $subRequest->getUri(), $response->getStatusCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1028,7 +1028,7 @@ class Esi
|
|||||||
$subRequest = Request::create($uri, 'get', array(), $cache->getRequest()->cookies->all(), array(), $cache->getRequest()->server->all());
|
$subRequest = Request::create($uri, 'get', array(), $cache->getRequest()->cookies->all(), array(), $cache->getRequest()->server->all());
|
||||||
try {
|
try {
|
||||||
$response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
|
$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()));
|
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $subRequest->getUri(), $response->getStatusCode()));
|
||||||
}
|
}
|
||||||
return $response->getContent();
|
return $response->getContent();
|
||||||
|
Reference in New Issue
Block a user