Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version of symfony: 2.* Step to reproduce:
$resp = new \Symfony\Component\HttpFoundation\Response('test',\Symfony\Component\HttpFoundation\Response::HTTP_UNPROCESSABLE_ENTITY); $resp->headers->set('MyHeader','MyValue'); $resp->send();
Result:
curl -vvv -XGET http://ololo-pew-pew/api/v1/performance/tick [SKIPPED] < HTTP/1.1 422 [SKIPPED]
Expected:
curl -vvv -XGET http://ololo-pew-pew/api/v1/performance/tick [SKIPPED] < HTTP/1.1 422 Unprocessable Entity [SKIPPED]
This behaviour occurs due hhvm header implementation: https://github.com/facebook/hhvm/blob/44b242ba185856a3e6661d8179039d8274d0d4a9/hphp/runtime/ext/std/ext_std_network.cpp#L284 https://github.com/facebook/hhvm/blob/4a3be43df46ea29b5d7860aaa524bd3ee8aaf4c8/hphp/runtime/server/transport.cpp#L521 https://github.com/facebook/hhvm/blob/f3fb59b8639668cc6ec26db56da350e04e2fe182/hphp/runtime/server/http-protocol.cpp#L940
hhvm rewrite HTTP response header on each call header() function if pass response code
I think that the simplest workaround is change: https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/HttpFoundation/Response.php#L332 to
// headers foreach ($this->headers->allPreserveCase() as $name => $values) { foreach ($values as $value) { header($name.': '.$value, false, $this->statusCode); } } // status header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
The text was updated successfully, but these errors were encountered:
See #16669
Sorry, something went wrong.
bug #16676 [HttpFoundation] Workaround HHVM rewriting HTTP response l…
5f93188
…ine (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
Closing because this bug was fixed in #16669.
No branches or pull requests
Version of symfony: 2.*
Step to reproduce:
Result:
Expected:
This behaviour occurs due hhvm header implementation:
https://github.com/facebook/hhvm/blob/44b242ba185856a3e6661d8179039d8274d0d4a9/hphp/runtime/ext/std/ext_std_network.cpp#L284
https://github.com/facebook/hhvm/blob/4a3be43df46ea29b5d7860aaa524bd3ee8aaf4c8/hphp/runtime/server/transport.cpp#L521
https://github.com/facebook/hhvm/blob/f3fb59b8639668cc6ec26db56da350e04e2fe182/hphp/runtime/server/http-protocol.cpp#L940
hhvm rewrite HTTP response header on each call header() function if pass response code
I think that the simplest workaround is change:
https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/HttpFoundation/Response.php#L332
to
The text was updated successfully, but these errors were encountered: