Explorar el Código

[FrameworkBundle] Allow any 2xx response code in a subrequest

Igor Wiedler hace 14 años
padre
commit
8cb3a237cc
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/Symfony/Bundle/FrameworkBundle/HttpKernel.php

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/HttpKernel.php

@@ -130,7 +130,7 @@ class HttpKernel extends BaseHttpKernel
         try {
             $response = $this->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).', $request->getUri(), $response->getStatusCode()));
             }