Skip to content

Commit

Permalink
fix: Collect debug information even when inject is set to false. (#1498)
Browse files Browse the repository at this point in the history
Co-authored-by: uniho <uniho@users.noreply.github.com>
  • Loading branch information
uniho and uniho authored Feb 13, 2024
1 parent 665069c commit b799677
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/LaravelDebugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ public function modifyResponse(Request $request, Response $response)
$app['log']->error('Debugbar exception: ' . $e->getMessage());
}
} elseif (
!$app['config']->get('debugbar.inject', true) ||
($response->headers->has('Content-Type') &&
strpos($response->headers->get('Content-Type'), 'html') === false) ||
$request->getRequestFormat() !== 'html' ||
Expand All @@ -863,7 +864,7 @@ public function modifyResponse(Request $request, Response $response)
} catch (\Exception $e) {
$app['log']->error('Debugbar exception: ' . $e->getMessage());
}
} elseif ($app['config']->get('debugbar.inject', true)) {
} else {
try {
$this->injectDebugbar($response);
} catch (\Exception $e) {
Expand Down

0 comments on commit b799677

Please sign in to comment.