Skip to content

Commit 02a2e8b

Browse files
Merge branch '7.2' into 7.3
* 7.2: Fixes XliffFileDumperTest for 6.4 [HttpClient] Don't send any default content-type when the body is empty [VarExporter] Fix lazy objects with hooked properties [Translation] check empty notes ntfy-notifier: tfix in description
2 parents 551c526 + 78981a2 commit 02a2e8b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

HttpClientTrait.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,11 @@ private static function normalizeBody($body, array &$normalizedHeaders = [])
355355
}
356356
});
357357

358-
$body = http_build_query($body, '', '&');
358+
if ('' === $body = http_build_query($body, '', '&')) {
359+
return '';
360+
}
359361

360-
if ('' === $body || !$streams && !str_contains($normalizedHeaders['content-type'][0] ?? '', 'multipart/form-data')) {
362+
if (!$streams && !str_contains($normalizedHeaders['content-type'][0] ?? '', 'multipart/form-data')) {
361363
if (!str_contains($normalizedHeaders['content-type'][0] ?? '', 'application/x-www-form-urlencoded')) {
362364
$normalizedHeaders['content-type'] = ['Content-Type: application/x-www-form-urlencoded'];
363365
}

0 commit comments

Comments
 (0)