fvsch/kirby-staticbuilder

Broken report page if some pages send HTTP headers

fvsch opened this issue · 2 comments

fvsch commented

In a feed.php controller:

header::type('application/atom+xml');

Response when building the full list of pages which does contain several feed.txt pages is HTTP 404 with Content-Type: application/atom+xml; charset=UTF-8 and no body.

fvsch commented

Looks like redirection headers are being sent too.

fvsch commented

It seems that:

  • Kirby itself respects the $headers=false param for Kirby::render
  • User code (in templates, controllers, page methods, plugins etc.) using the header class, PHP's header(), the go() helper, etc. will not follow this param (quite logically).

This can’t be changed without changes to user code (header_remove() in the plugin code has no effect whatsoever…), so the question seems to be: what’s a good way (current or future) with Kirby to know if a page is being rendered with $headers=true or not, or maybe what’s a good way to defer sending headers to Kirby.