Skip to content

Commit 03f0d7d

Browse files
authored
🩹 Terminate after handling non-WordPress requests (Fixes #444) (#450)
1 parent fcd9dbf commit 03f0d7d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Roots/Acorn/Application/Concerns/Bootable.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,22 @@ protected function registerRequestHandler(
238238
}, 100);
239239
}
240240

241+
/**
242+
* Handle the request.
243+
*/
244+
public function handleRequest(Request $request): void
245+
{
246+
$kernel = $this->make(HttpKernelContract::class);
247+
248+
$response = $kernel->handle($request);
249+
250+
$response->send();
251+
252+
$kernel->terminate($request, $response);
253+
254+
exit((int) $response->isServerError());
255+
}
256+
241257
/**
242258
* Retrieve the boot configuration.
243259
*/

0 commit comments

Comments
 (0)