Skip to content

Commit 5f93188

Browse files
bug symfony#16676 [HttpFoundation] Workaround HHVM rewriting HTTP response line (nicolas-grekas)
This PR was merged into the 2.3 branch. Discussion ---------- [HttpFoundation] Workaround HHVM rewriting HTTP response line | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#16481, symfony#9365 | License | MIT | Doc PR | - Commits ------- 5013f98 [HttpFoundation] Workaround HHVM rewriting HTTP response line
2 parents 7ddfc5f + 5013f98 commit 5f93188

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,16 +268,16 @@ public function sendHeaders()
268268
return $this;
269269
}
270270

271-
// status
272-
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText));
273-
274271
// headers
275272
foreach ($this->headers->allPreserveCase() as $name => $values) {
276273
foreach ($values as $value) {
277274
header($name.': '.$value, false);
278275
}
279276
}
280277

278+
// status
279+
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
280+
281281
// cookies
282282
foreach ($this->headers->getCookies() as $cookie) {
283283
setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());

0 commit comments

Comments
 (0)