8000 [HttpFoundation] replace any preexisting Content-Type headers by nicolas-grekas · Pull Request #29057 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpFoundation] replace any preexisting Content-Type headers #29057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[HttpFoundation] replace any preexisting Content-Type headers
  • Loading branch information
nicolas-grekas committed Nov 1, 2018
commit de2ce58a4ff41bf91eedb14ad421c620e4c7f8ee
3 changes: 2 additions & 1 deletion src/Symfony/Component/HttpFoundation/Response.php
Original file line number Diff line number Diff line change
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