From eaf04a8eaeff60ee6c61e9ae2f1de9d544de8d4b Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Fri, 31 Jul 2020 10:55:32 +0200 Subject: [PATCH] Don't try to log requests as curl when the requests are bigger than 256kb --- app/Logger/LoggedRequest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Logger/LoggedRequest.php b/app/Logger/LoggedRequest.php index 8c389a1..0932c62 100644 --- a/app/Logger/LoggedRequest.php +++ b/app/Logger/LoggedRequest.php @@ -308,6 +308,12 @@ class LoggedRequest implements \JsonSerializable protected function getRequestAsCurl(): string { + $maxRequestLength = 256000; + + if (strlen($this->rawRequest) > $maxRequestLength) { + return ''; + } + try { return (new CurlFormatter())->format(parse_request($this->rawRequest)); } catch (\Throwable $e) {