Skip to content

Commit

Permalink
bug #29057 [HttpFoundation] replace any preexisting Content-Type head…
Browse files Browse the repository at this point in the history
…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 46e3745
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Symfony/Component/HttpFoundation/Response.php
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 46e3745

Please sign in to comment.