bug #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 | #16481, #9365
| License       | MIT
| Doc PR        | -

Commits
-------

5013f98 [HttpFoundation] Workaround HHVM rewriting HTTP response line
This commit is contained in:
Nicolas Grekas 2015-11-26 10:19:28 +01:00
commit 5f93188dc0
1 changed files with 3 additions and 3 deletions

View File

@ -268,9 +268,6 @@ class Response
return $this;
}
// status
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText));
// headers
foreach ($this->headers->allPreserveCase() as $name => $values) {
foreach ($values as $value) {
@ -278,6 +275,9 @@ class Response
}
}
// status
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
// cookies
foreach ($this->headers->getCookies() as $cookie) {
setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());