[11.x] Fixes Illuminate\Http\Response to output empty string if $content is set to null#53872
Conversation
`$content` is set to `null` 1. Symfony set the content to `null` for `response()->noContent()` https://github.com/symfony/http-foundation/blob/e88a66c3997859532bc2ddd6dd8f35aba2711744/Response.php#L246-L249 2. This cause issue with PSR-7 HTTP Stream in Octane fixed laravel/octane#972 Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
| #[\Override] | ||
| public function getContent(): string|false | ||
| { | ||
| return transform(parent::getContent(), fn ($content) => $content, ''); |
There was a problem hiding this comment.
Why not just?
return parent::getContent() ?? '';|
Also, for the same hash you linked the Maybe the problem is something else? |
|
Does octane calls |
|
I'm a little hesitant to follow Symfony style since their phpdoc indicate Also with |
|
I agree, but our override at the end defers to theirs From our current code |
nullforresponse()->noContent()https://github.com/symfony/http-foundation/blob/e88a66c3997859532bc2ddd6dd8f35aba2711744/Response.php#L246-L249fixed laravel/octane#972