klein/klein.php

Error display reporting leads to response code 200

Opened this issue · 2 comments

Reproduce:

  • error_reporting(E_ALL)
  • generate a php warning
  • set response code to 500 like $response->code("500"); return;
    -> framework will return code 200 nevertheless.

Can you post a small code sample that demonstrates only this bug?

Depending on where your error is happening, the output of the text of the error might be causing php to send content before the http headers are set. Try wrapping the area where the error is happening in an output buffer (ob_start ... ob_get_clean).