Skip to content

Commit

Permalink
[11.x] Fix cached health endpoint not working when in maintenance mode (
Browse files Browse the repository at this point in the history
#53974)

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone authored Dec 19, 2024
1 parent fe5d94e commit 5331525
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ public function withRouting(?Closure $using = null,
{
if (is_null($using) && (is_string($web) || is_array($web) || is_string($api) || is_array($api) || is_string($pages) || is_string($health)) || is_callable($then)) {
$using = $this->buildRoutingCallback($web, $api, $pages, $health, $apiPrefix, $then);

if (is_string($health)) {
PreventRequestsDuringMaintenance::except($health);
}
}

AppRouteServiceProvider::loadRoutesUsing($using);
Expand Down Expand Up @@ -212,8 +216,6 @@ protected function buildRoutingCallback(array|string|null $web,
}

if (is_string($health)) {
PreventRequestsDuringMaintenance::except($health);

Route::get($health, function () {
$exception = null;

Expand Down

0 comments on commit 5331525

Please sign in to comment.