klein / klein.php

A fast & flexible router
MIT License
2.66k stars 290 forks source link

Headers not sent if buffer length exceedes value defined in ini.output_buffering #399

Open rekcuFniarB opened 5 years ago

rekcuFniarB commented 5 years ago

Headers defined with $response->header() not sent if buffer length exceedes value defined in ini.output_buffering (4096 by default).

Solution may be setting output_buffering to "On" (unlimited) but it's not always good idea.

I found out that in this case output without headers starts at Klein.php:695 and then it tries to send headers at 706 but fails due to output already happened (headers_sent() == true).

Shouldn't $this->response->send() be called before 694?