esponseFactory()->response('Negotiation failed', StatusCodeInterface::STATUS_NOT_ACCEPTABLE); } } // Not found return $handler->handle($request); } // Add the route as attribute of the request $request = $request->withAttribute('route', $route); // This middleware cannot run until after the routing, as it needs to know the route. $post_routing_middleware = [CheckCsrf::class]; // Firstly, apply the route middleware $route_middleware = $route->extras['middleware'] ?? []; // Secondly, apply any module middleware $module_middleware = $this->module_service->findByInterface(MiddlewareInterface::class)->all(); // Finally, run the handler using middleware $handler_middleware = [RequestHandler::class]; $middleware = array_merge( $post_routing_middleware, $route_middleware, $module_middleware, $handler_middleware ); // Add the matched attributes to the request. foreach ($route->attributes as $key => $value) { if ($key === 'tree') { $value = $this->tree_service->all()->get($value); app()->instance(Tree::class, $value); // Missing mandatory parameter? Let the default handler take care of it. if ($value === null && str_contains($route->path, '{tree}')) { return $handler->handle($request); } } $request = $request->withAttribute((string) $key, $value); } // Bind the updated request into the container app()->instance(ServerRequestInterface::class, $request); return Webtrees::dispatch($request, $middleware); } } Uncaught RuntimeException: Headers already sent at /hp/ct/ab/dd/www/genealogie/app/Http/Middleware/Router.php:1 in /hp/ct/ab/dd/www/genealogie/app/Http/Middleware/EmitResponse.php:98 Stack trace: #0 /hp/ct/ab/dd/www/genealogie/app/Http/Middleware/EmitResponse.php(59): Fisharebest\Webtrees\Http\Middleware\EmitResponse->assertHeadersNotEmitted() #1 /hp/ct/ab/dd/www/genealogie/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #2 /hp/ct/ab/dd/www/genealogie/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #3 /hp/ct/ab/dd/www/genealogie/app/Webtrees.php(275): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest)) #4 /hp/ct/ab/dd/www/genealogie/app/Webtrees.php(262): Fisharebest\Webtrees\Webtrees::dispatch(Object(Nyholm\Psr7\ServerRequest), Array) #5 /hp/ct/ab/dd/www/genealogie/index.php(51): Fisharebest\Webtrees\Webtrees->httpRequest() #6 {main} thrown

/hp/ct/ab/dd/www/genealogie/app/Http/Middleware/EmitResponse.php: 98