Don't return a 403 when returning resources for a suspended server; closes #2279

This commit is contained in:
Dane Everitt 2020-08-30 09:54:59 -07:00
parent 6a442c1fd3
commit 906cfce81c
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -8,6 +8,7 @@ use Pterodactyl\Models\Server;
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
use Symfony\Component\HttpKernel\Exception\ConflictHttpException; use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
class AuthenticateServerAccess class AuthenticateServerAccess
@ -64,8 +65,10 @@ class AuthenticateServerAccess
} }
} }
if ($server->suspended) { if ($server->suspended && !$request->routeIs('api:client:server.resources')) {
throw new AccessDeniedHttpException('This server is currently suspended and the functionality requested is unavailable.'); throw new BadRequestHttpException(
'This server is currently suspended and the functionality requested is unavailable.'
);
} }
if (! $server->isInstalled()) { if (! $server->isInstalled()) {