Permalink
Browse files

bug #29057 [HttpFoundation] replace any preexisting Content-Type head…

…ers (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
-------

de2ce58 [HttpFoundation] replace any preexisting Content-Type headers
  • Loading branch information...
nicolas-grekas committed Nov 8, 2018
2 parents def89e2 + de2ce58 commit 46e3745a03e199e64cc0fcf3284a96b5a25dcee9
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/Symfony/Component/HttpFoundation/Response.php
@@ -344,8 +344,9 @@ public function sendHeaders()
// 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);
}
}

0 comments on commit 46e3745

Please sign in to comment.