bug #29057 [HttpFoundation] replace any preexisting Content-Type headers (nicolas-grekas)
This PR was merged into the 2.8 branch.
Discussion
----------
[HttpFoundation] replace any preexisting Content-Type headers
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21204
| License | MIT
| Doc PR | -
Commits
-------
de2ce58a4f
[HttpFoundation] replace any preexisting Content-Type headers
This commit is contained in:
commit
46e3745a03
|
@ -344,8 +344,9 @@ class Response
|
|||
|
||||
// headers
|
||||
foreach ($this->headers->allPreserveCase() as $name => $values) {
|
||||
$replace = 0 === strcasecmp($name, 'Content-Type');
|
||||
foreach ($values as $value) {
|
||||
header($name.': '.$value, false, $this->statusCode);
|
||||
header($name.': '.$value, $replace, $this->statusCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue