Skip to content

Commit 7e8f4cb

Browse files
committed
Fixed response status code
1 parent c659cbb commit 7e8f4cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Codeception/Util/Connector/Nette.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Nette\DI\Container;
66
use Nette\Diagnostics\Debugger;
77
use Nette\Environment;
8+
use Nette\Http\IResponse;
89
use Symfony\Component\BrowserKit\Client;
910
use Symfony\Component\BrowserKit\Request;
1011
use Symfony\Component\BrowserKit\Response;
@@ -52,7 +53,7 @@ public function doRequest($request)
5253
$content = ob_get_clean();
5354

5455
$httpResponse = $this->container->getByType('Nette\Http\IResponse');
55-
$code = $httpResponse->getCode();
56+
$code = $httpResponse->getCode() ?: IResponse::S200_OK; // @see https://github.com/nette/nette/issues/1263
5657
$headers = $httpResponse->getHeaders();
5758

5859
$repsonse = new Response($content, $code, $headers);

0 commit comments

Comments
 (0)