Skip to content

Commit 4c61c18

Browse files
committed
Add default value for Accept header
1 parent c300a71 commit 4c61c18

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/HttpClient/HttpClientTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ private static function prepareRequest(?string $method, ?string $url, array $opt
5555
$options['normalized_headers']['content-type'] = [$options['headers'][] = 'Content-Type: application/json'];
5656
}
5757
}
58+
59+
if (!isset($options['normalized_headers']['accept'])) {
60+
$options['normalized_headers']['accept'] = [$options['headers'][] = 'Accept: *'];
61+
}
5862

5963
if (isset($options['body'])) {
6064
$options['body'] = self::normalizeBody($options['body']);

0 commit comments

Comments
 (0)