You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the status function is invoked on swoole response after calling the write function, no matter the code you've passed, the final status code will be 200.
To prevent this, the call to the status function in the following snippet should be moved before to the copyHeaders function call:
class ResponseMerger
{
// ...publicfunctiontoSwoole(ResponseInterface$psrResponse, Response$swooleResponse): Response
{
// Set here the status on swooleResponse $this->copyHeaders($psrResponse, $swooleResponse);
$this->copyBody($psrResponse, $swooleResponse);
$swooleResponse->status($psrResponse->getStatusCode());
return$swooleResponse;
}
//...
}
The text was updated successfully, but these errors were encountered:
If the status function is invoked on swoole response after calling the write function, no matter the code you've passed, the final status code will be 200.
swoole/swoole-src#4198 (comment)
To prevent this, the call to the status function in the following snippet should be moved before to the copyHeaders function call:
The text was updated successfully, but these errors were encountered: