Skip to content

Commit

Permalink
Client - log fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pekral committed Nov 18, 2020
1 parent e3e2a43 commit 13cf46d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 4 additions & 5 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
<!-- ============================================ -->
<!-- Target: check -->
<!-- ============================================ -->
<target name="check" depends="lint, phpcs, phpstan, tests">
<exec command="vendor/bin/paratest tests" checkreturn="true" passthru="true"/>
</target>
<target name="check" depends="lint, phpcs, phpstan, tests"/>

<!-- ============================================ -->
<!-- Target: fix -->
<!-- Target: fix -->
<!-- ============================================ -->
<target name="fix">
<exec command="composer normalize" passthru="true" checkreturn="true"/>
Expand Down Expand Up @@ -42,6 +41,6 @@
<!-- Target: tests -->
<!-- ============================================ -->
<target name="tests">
<exec command="vendor/bin/phpunit tests" passthru="true" checkreturn="true" level="error"/>
<exec command="vendor/bin/paratest tests" passthru="true" checkreturn="true" level="error"/>
</target>
</project>
10 changes: 7 additions & 3 deletions src/Http/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 13cf46d

Please sign in to comment.