diff --git a/app/Logger/LoggedRequest.php b/app/Logger/LoggedRequest.php index e5978f7..ddab730 100644 --- a/app/Logger/LoggedRequest.php +++ b/app/Logger/LoggedRequest.php @@ -66,7 +66,7 @@ class LoggedRequest implements \JsonSerializable 'body' => $this->isBinary($this->rawRequest) ? 'BINARY' : $this->parsedRequest->getContent(), 'query' => $this->parsedRequest->getQuery()->toArray(), 'post' => $this->getPostData(), - 'curl' => '', //(new CurlFormatter())->format(parse_request($this->rawRequest)), + 'curl' => $this->getRequestAsCurl(), 'additional_data' => $this->additionalData, ], ]; @@ -208,4 +208,13 @@ class LoggedRequest implements \JsonSerializable { return $this->startTime->diffInMilliseconds($this->stopTime, false); } + + protected function getRequestAsCurl(): string + { + try { + return (new CurlFormatter())->format(parse_request($this->rawRequest)); + } catch (\Exception $e) { + return ''; + } + } } diff --git a/app/Server/Connections/HttpConnection.php b/app/Server/Connections/HttpConnection.php index 96de039..63b9b1a 100644 --- a/app/Server/Connections/HttpConnection.php +++ b/app/Server/Connections/HttpConnection.php @@ -20,6 +20,7 @@ class HttpConnection public function send($data) { $this->emit('data', [$data]); + $this->socket->send($data); } diff --git a/composer.json b/composer.json index c162753..81504f0 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,6 @@ "ext-json": "*" }, "require-dev": { - "bfunky/http-parser": "^2.2", "cboden/ratchet": "^0.4.2", "clue/block-react": "^1.3", "clue/buzz-react": "^2.7",