Closed geggleto closed 8 years ago
That's my point :)
if you forget the return it's so stupid hard to debug because no errors are raised ;)
On Wed, Jun 15, 2016 at 4:09 PM, Martijn Wennink notifications@github.com wrote:
Is the code an exact copy? You forgot a return
$this->post('/create', function (Request $request, Response $response) use ($post) { return $post->create($request, $response); });
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/slimphp/Slim/issues/1910#issuecomment-226304762, or mute the thread https://github.com/notifications/unsubscribe/AD100ndmAamvwmPPi6XsvBmfjsx5ARUlks5qMFvogaJpZM4I2vJ9 .
Haha yeah, I reread your post and noticed that. I had already removed it, hoping nobody would notice. Guess I was too late :disappointed:
Not returning anything is an intentional state. You can turn it off by setting outputBuffering
to false
.
We should probably warn if we detect that the output buffer is empty and response wasn't returned though.
@akrabat sounds like a lot of effort, idk i think it can be covered in 4.0
We need to add a check to Route Actions to ensure they are returning a response.
In the event of no returned response a 200 Okay is generated.... we should be raising an exception to aide the developer in debugging.
Example
Expected
Options
We should provide an additional container key to toggle this functionality on/off.
enforceResponseFromRouteAction