port fix from 1.0 for display exceptions not returning correctly on api

This commit is contained in:
Sky Mulley
2026-10-06 02:10:17 +01:00
parent 90fc8c7005
commit 9c623eca71
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ class DisplayException extends PterodactylException implements HttpExceptionInte
*/
public function render(Request $request): JsonResponse|RedirectResponse
{
if ($request->expectsJson()) {
if ($request->expectsJson() || $request->is('api/*')) {
return response()->json(ApiErrorResponse::toArray($this), $this->getStatusCode(), $this->getHeaders());
}