Better middleware for routes, cleaned up API, removed old API calls
New API routes for Server allow specifying which fractal objects to load into the request, thus making it possible to fine-tune what data is returned.
This commit is contained in:
parent
ddb82ac3ca
commit
97773300ed
15 changed files with 304 additions and 747 deletions
|
@ -46,7 +46,7 @@ class Handler extends ExceptionHandler
|
|||
*/
|
||||
public function render($request, Exception $exception)
|
||||
{
|
||||
if ($request->expectsJson() || $request->isJson() || $request->is('api/*', 'remote/*', 'daemon/*')) {
|
||||
if ($request->expectsJson() || $request->isJson() || $request->is(...config('pterodactyl.json_routes'))) {
|
||||
|
||||
if (config('app.debug')) {
|
||||
$report = [
|
||||
|
@ -56,7 +56,7 @@ class Handler extends ExceptionHandler
|
|||
}
|
||||
|
||||
$response = response()->json([
|
||||
'error' => $exception->getMessage(),
|
||||
'error' => (config('app.debug')) ? $exception->getMessage() : 'An unhandled exception was encountered with this request.',
|
||||
'exception' => ! isset($report) ?: $report,
|
||||
], ($this->isHttpException($exception)) ? $exception->getStatusCode() : 500, [], JSON_UNESCAPED_SLASHES);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue