diff --git a/src/Servers/Reverb/Factory.php b/src/Servers/Reverb/Factory.php index 3d9f6c5d..6e994b43 100644 --- a/src/Servers/Reverb/Factory.php +++ b/src/Servers/Reverb/Factory.php @@ -16,6 +16,7 @@ use React\Http\HttpServer; use React\Http\Message\Response; use React\Http\Middleware\LimitConcurrentRequestsMiddleware; +use React\Http\Middleware\RequestBodyBufferMiddleware; use React\Socket\SocketServer; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; @@ -27,9 +28,6 @@ class Factory */ public static function make(string $host = '0.0.0.0', string $port = '8080', LoopInterface $loop = null) { - set_time_limit(0); - ob_implicit_flush(); - $loop = $loop ?: Loop::get(); $socket = new SocketServer("{$host}:{$port}", [], $loop); @@ -37,6 +35,7 @@ public static function make(string $host = '0.0.0.0', string $port = '8080', Loo $server = new HttpServer( $loop, new LimitConcurrentRequestsMiddleware(10000), + new RequestBodyBufferMiddleware(2 * 1024 * 1024), new WebSocketMiddleware(App::make(Server::class)), function (ServerRequestInterface $request) { $payload = json_decode($request->getBody()->getContents(), true);