Skip to content

Commit

Permalink
Fixes #3 An error occurred creating the expectation "Syntax error" on…
Browse files Browse the repository at this point in the history
… Respo… (#4)

* #3 An error occurred creating the expectation "Syntax error" on Respond with large Body

* #3 An error occurred creating the expectation "Syntax error" on Respond with large Body
- Fixed tests
  • Loading branch information
enduro44 authored Nov 16, 2020
1 parent 2e08521 commit 29ac9a2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Http/Implementation/ReactPhpServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
use Psr\Log\LoggerInterface;
use React\EventLoop\Factory as EventLoop;
use React\EventLoop\LoopInterface;
use React\Http\Middleware\RequestBodyBufferMiddleware;
use React\Http\Middleware\RequestBodyParserMiddleware;
use React\Http\Middleware\StreamingRequestMiddleware;
use React\Http\Server;
use React\Socket\Server as ReactSocket;

Expand Down Expand Up @@ -60,6 +63,9 @@ public function listen(HostInterface $host, Port $port, ?SecureOptions $secureOp
{
$this->http = new Server(
$this->loop,
new StreamingRequestMiddleware(),
new RequestBodyBufferMiddleware(),
new RequestBodyParserMiddleware(),
function (ServerRequestInterface $request) {
return $this->onRequest($request);
}
Expand All @@ -70,7 +76,7 @@ function (ServerRequestInterface $request) {
$this->http->listen($this->socket);

// Dispatch pending signals periodically
if (function_exists('pcntl_signal_dispatch')) {
if (\function_exists('pcntl_signal_dispatch')) {
$this->loop->addPeriodicTimer(0.5, function () {
pcntl_signal_dispatch();
});
Expand Down

0 comments on commit 29ac9a2

Please sign in to comment.