Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 46e3745

Browse filesBrowse files
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 ------- de2ce58 [HttpFoundation] replace any preexisting Content-Type headers
2 parents def89e2 + de2ce58 commit 46e3745
Copy full SHA for 46e3745

File tree

1 file changed

+2
-1
lines changed
Filter options

1 file changed

+2
-1
lines changed

‎src/Symfony/Component/HttpFoundation/Response.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Response.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,9 @@ public function sendHeaders()
344344

345345
// headers
346346
foreach ($this->headers->allPreserveCase() as $name => $values) {
347+
$replace = 0 === strcasecmp($name, 'Content-Type');
347348
foreach ($values as $value) {
348-
header($name.': '.$value, false, $this->statusCode);
349+
header($name.': '.$value, $replace, $this->statusCode);
349350
}
350351
}
351352

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.