Skip to content

Commit 9f62a08

Browse files
authored
Merge pull request #2 from Micro-PHP/v1.0.2-release
Up decoration version and fix bug when flush is true
2 parents d9a0589 + fbd5f54 commit 9f62a08

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Business/Executor/HttpExceptionExecutorDecorator.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ public function __construct(
3131
public function execute(Request $request, bool $flush = true): Response
3232
{
3333
try {
34-
return $this->decorated->execute($request, $flush);
34+
$response = $this->decorated->execute($request, false);
35+
if ($flush) {
36+
$response->send();
37+
}
38+
39+
return $response;
3540
} catch (\Throwable $throwable) {
3641
if (!($throwable instanceof HttpException)) {
3742
$throwable = new HttpInternalServerException('Internal Server Error.', $throwable);

src/HttpExceptionResponsePluginConfiguration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class HttpExceptionResponsePluginConfiguration extends PluginConfiguration imple
2323
{
2424
public const CFG_DECORATED_WEIGHT = 'MICRO_HTTP_EXCEPTION_DECORATION_WEIGHT';
2525

26-
public const CFG_DECORATION_WEIGHT_DEFAULT = 20;
26+
public const CFG_DECORATION_WEIGHT_DEFAULT = 100;
2727

2828
public function getDecoratedLevel(): int
2929
{

0 commit comments

Comments
 (0)