Skip to content

Commit 50c2ee0

Browse files
committed
Merge branch '4.4'
* 4.4: [Twig] Remove dead code Minor updates in the new Welcome page Add gitignore file for Symfony 4.3 Add gitignore file for Symfony 3.4 [Inflector] Add .gitignore file [Messenger] Fix exception message of failed message is dropped on retry Add default value for Accept header [HttpClient] Add .gitignore file [Finder] Adjust regex to correctly match comments in gitignore contents [Security] Removed unused argument in Test [Console] Get dimensions from stty on windows if possible [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
2 parents fc34b42 + 813e856 commit 50c2ee0

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vendor/
2+
composer.lock
3+
phpunit.xml

HttpClientTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ private static function prepareRequest(?string $method, ?string $url, array $opt
5454
}
5555
}
5656

57+
if (!isset($options['normalized_headers']['accept'])) {
58+
$options['normalized_headers']['accept'] = [$options['headers'][] = 'Accept: *'];
59+
}
60+
5761
if (isset($options['body'])) {
5862
$options['body'] = self::normalizeBody($options['body']);
5963
}

Tests/HttpClientTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function provideRemoveDotSegments()
172172
public function testAuthBearerOption()
173173
{
174174
[, $options] = self::prepareRequest('POST', 'http://example.com', ['auth_bearer' => 'foobar'], HttpClientInterface::OPTIONS_DEFAULTS);
175-
$this->assertSame(['Authorization: Bearer foobar'], $options['headers']);
175+
$this->assertSame(['Accept: *', 'Authorization: Bearer foobar'], $options['headers']);
176176
$this->assertSame(['Authorization: Bearer foobar'], $options['normalized_headers']['authorization']);
177177
}
178178

0 commit comments

Comments
 (0)