From cc5b59f94c7221ff773daf067c72030dc3a7e853 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Fri, 8 Mar 2024 14:57:03 +0000 Subject: [PATCH] catch request parsing exception (#55) --- src/Servers/Reverb/Http/Server.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Servers/Reverb/Http/Server.php b/src/Servers/Reverb/Http/Server.php index 1574803d..cc0f1509 100644 --- a/src/Servers/Reverb/Http/Server.php +++ b/src/Servers/Reverb/Http/Server.php @@ -70,6 +70,8 @@ protected function createRequest(string $message, Connection $connection): ?Requ $request = Request::from($message, $connection); } catch (OverflowException $e) { $this->close($connection, 413, 'Payload too large.'); + } catch (Throwable $e) { + $this->close($connection, 400, 'Bad request.'); } return $request ?? null;