-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected: 4.4
Description
symfony/src/Symfony/Component/BrowserKit/HttpBrowser.php
Lines 44 to 48 in 8ea7c26
$headers = $this->getHeaders($request); | |
[$body, $extraHeaders] = $this->getBodyAndExtraHeaders($request); | |
$response = $this->client->request($request->getMethod(), $request->getUri(), [ | |
'headers' => array_merge($headers, $extraHeaders), |
$extraHeaders includes a content-type, guessed here:
symfony/src/Symfony/Component/BrowserKit/HttpBrowser.php
Lines 69 to 73 in 8ea7c26
if (null !== $content = $request->getContent()) { | |
$part = new TextPart($content, 'utf-8', 'plain', '8bit'); | |
return [$part->bodyToString(), $part->getPreparedHeaders()->toArray()]; | |
} |
and it's effectively overwriting the existing one in $headers due the array_merge.
dd($headers, $extraHeaders, array_merge($headers, $extraHeaders));
array:6 [
"user-agent" => "Symfony BrowserKit"
"content-type" => "application/json"
]
array [
0 => "Content-Type: text/plain; charset=utf-8"
1 => "Content-Transfer-Encoding: 8bit"
]
array [
"user-agent" => "Symfony BrowserKit"
"content-type" => "application/json"
0 => "Content-Type: text/plain; charset=utf-8"
1 => "Content-Transfer-Encoding: 8bit"
]