From 0b8d528270792834f8e8ab80b1d790189bbfaa59 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Tue, 14 Nov 2023 20:52:40 +0000 Subject: [PATCH] wip --- src/Servers/Reverb/Factory.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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);