Skip to content

Commit

Permalink
Update HttpClient.php [Issue beyondcode#425 fix]
Browse files Browse the repository at this point in the history
Handling exception of failed header parsing when logging a request.
  • Loading branch information
alwayshopeless authored Oct 28, 2024
1 parent 5157e76 commit 816c3a8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/Client/Http/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use App\Client\Http\Modifiers\CheckBasicAuthentication;
use App\Logger\RequestLogger;
use GuzzleHttp\Psr7\Message;
use Illuminate\Support\Facades\Log;
use Laminas\Http\Header\Exception\RuntimeException;
use Laminas\Http\Request;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
Expand Down Expand Up @@ -50,7 +52,11 @@ public function performRequest(string $requestData, WebSocket $proxyConnection =

$this->request = $this->parseRequest($requestData);

$this->logger->logRequest($requestData, $this->request);
try {
$this->logger->logRequest($requestData, $this->request);
} catch (RuntimeException $exception) {
Log::error($exception->getMessage());
}

$request = $this->passRequestThroughModifiers(parse_request($requestData), $proxyConnection);

Expand Down

0 comments on commit 816c3a8

Please sign in to comment.