diff --git a/src/Roots/Acorn/Bootloader.php b/src/Roots/Acorn/Bootloader.php index 9122c8ad..6be1e469 100644 --- a/src/Roots/Acorn/Bootloader.php +++ b/src/Roots/Acorn/Bootloader.php @@ -228,9 +228,11 @@ protected function bootHttp(ApplicationContract $app) protected function registerWordPressRoute(ApplicationContract $app) { $app->make('router') - ->any('{any?}', fn () => tap(response(), function (Response $response) { + ->any('{any?}', fn () => tap(response(''), function (Response $response) { foreach (headers_list() as $header) { - header_remove($header); + if (! headers_sent()) { + header_remove($header); + } $response->header(...explode(': ', $header)); }