Skip to content

Commit 124a545

Browse files
committed
fix #49: update boost injection tests
1 parent 6ca2d40 commit 124a545

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Middleware/InjectBoost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function handle(Request $request, Closure $next): Response
3232

3333
private function shouldInject(Response $response): bool
3434
{
35-
if (str_contains($response->headers->get('content-type'), 'html') === false) {
35+
if (str_contains($response->headers->get('content-type', ''), 'html') === false) {
3636
return false;
3737
}
3838

tests/Feature/Mcp/Tools/BrowserLogsTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@
9797

9898
test('@boostJs blade directive renders browser logger script', function () {
9999
// Ensure route exists
100-
Route::post('/_boost/browser-logs', function () {
101-
})->name('boost.browser-logs');
100+
Route::post('/_boost/browser-logs', function () {})->name('boost.browser-logs');
102101

103102
$blade = Blade::compileString('@boostJs');
104103

@@ -208,7 +207,7 @@
208207
HTML;
209208

210209
$request = Request::create('/');
211-
$response = new \Illuminate\Http\Response($html);
210+
$response = new \Illuminate\Http\Response($html, 200, ['Content-Type' => 'text/html']);
212211

213212
$result = $middleware->handle($request, function ($req) use ($response) {
214213
return $response;
@@ -277,7 +276,7 @@
277276
HTML;
278277

279278
$request = Request::create('/');
280-
$response = new \Illuminate\Http\Response($html);
279+
$response = new \Illuminate\Http\Response($html, 200, ['Content-Type' => 'text/html']);
281280

282281
$result = $middleware->handle($request, function ($req) use ($response) {
283282
return $response;

0 commit comments

Comments
 (0)