Skip to content

Commit 673d979

Browse files
authored
Merge pull request #79 from Dziamid-Harbatsevich/master
Config. default-problem-http-code for Controller
2 parents fb3bca4 + f066f9d commit 673d979

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

config/healthcheck.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@
7777
*/
7878
'default-response-code' => 200,
7979

80+
/*
81+
* Default code for HTTP health check when there any problem occured.
82+
* Will be used in the HealthCheckController's response.
83+
*/
84+
'default-problem-http-code' => 500,
85+
8086
/*
8187
* Default timeout for cURL requests for HTTP health check.
8288
*/

src/Controllers/HealthCheckController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ public function __invoke(Container $container)
4242
}
4343
}
4444

45-
return new Response($body, $isProblem ? 500 : 200);
45+
return new Response($body, $isProblem ? config('healthcheck.default-problem-http-code', 500) : 200);
4646
}
4747
}

0 commit comments

Comments
 (0)