From 13cf46dc993fc026887e94226902a85a7b7e7902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Kr=C3=A1l?= Date: Wed, 18 Nov 2020 20:47:22 +0100 Subject: [PATCH] Client - log fix --- build.xml | 9 ++++----- src/Http/HttpClient.php | 10 +++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/build.xml b/build.xml index 251ded0..b88df78 100644 --- a/build.xml +++ b/build.xml @@ -4,11 +4,10 @@ - - - + + - + @@ -42,6 +41,6 @@ - + diff --git a/src/Http/HttpClient.php b/src/Http/HttpClient.php index 4e57cf6..7cfa340 100644 --- a/src/Http/HttpClient.php +++ b/src/Http/HttpClient.php @@ -74,10 +74,14 @@ public function request( $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($config->getLogFilePath() !== null) { - $headersContents = []; + $headersContents = ['EMPTY']; - foreach ($headers as $key => $value) { - $headersContents[] = sprintf('%s:%s', $key, $value); + if (count($headers) > 0) { + $headersContents = []; + + foreach ($headers as $key => $value) { + $headersContents[] = sprintf('%s:%s', $key, $value); + } } $rootDir = dirname($config->getLogFilePath());