Skip to content

Commit

Permalink
Runner: empty output buffer before writing response
Browse files Browse the repository at this point in the history
  • Loading branch information
midahp committed Jul 31, 2024
1 parent 61dcf30 commit 0dca731
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Runner.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

declare(strict_types=1);

namespace Horde\Http\Server;

use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ServerRequestFactoryInterface;
use Psr\Http\Server\RequestHandlerInterface;

/**
Expand All @@ -25,6 +27,8 @@ public function __construct(RequestHandlerInterface $handler, ResponseWriterInte
public function run(ServerRequestInterface $request): void
{
$response = $this->handler->handle($request);
// make sure no additional output is buffered at this point
ob_end_clean();
$this->responseWriter->writeResponse($response);
}
}
}

0 comments on commit 0dca731

Please sign in to comment.