Skip to content

Commit 530558b

Browse files
committed
Update deprecated JSON response creation and unnecessary middleware
1 parent f5ad9b9 commit 530558b

File tree

11 files changed

+9
-91
lines changed

11 files changed

+9
-91
lines changed

app/Http/Controllers/Admin/NodeAutoDeployController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function __invoke(Request $request, Node $node)
7474
], ['r_nodes' => 1]);
7575
}
7676

77-
return JsonResponse::create([
77+
return new JsonResponse([
7878
'node' => $node->id,
7979
'token' => $key->identifier . $this->encrypter->decrypt($key->token),
8080
]);

app/Http/Controllers/Admin/Nodes/SystemInformationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __invoke(Request $request, Node $node)
3535
{
3636
$data = $this->repository->setNode($node)->getSystemInformation();
3737

38-
return JsonResponse::create([
38+
return new JsonResponse([
3939
'version' => $data['version'] ?? '',
4040
'system' => [
4141
'type' => Str::title($data['os'] ?? 'Unknown'),

app/Http/Controllers/Api/Application/Nodes/NodeConfigurationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ class NodeConfigurationController extends ApplicationApiController
1818
*/
1919
public function __invoke(GetNodeRequest $request, Node $node)
2020
{
21-
return JsonResponse::create($node->getConfiguration());
21+
return new JsonResponse($node->getConfiguration());
2222
}
2323
}

app/Http/Controllers/Api/Application/Servers/DatabaseController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function resetPassword(ServerDatabaseWriteRequest $request, Server $serve
7878
{
7979
$this->databasePasswordService->handle($database);
8080

81-
return JsonResponse::create([], JsonResponse::HTTP_NO_CONTENT);
81+
return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT);
8282
}
8383

8484
/**

app/Http/Controllers/Api/Client/ApiKeyController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ public function delete(ClientApiRequest $request, string $identifier)
102102
throw new NotFoundHttpException();
103103
}
104104

105-
return JsonResponse::create([], JsonResponse::HTTP_NO_CONTENT);
105+
return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT);
106106
}
107107
}

app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function index(Request $request, string $uuid)
4545
$server = $this->repository->getByUuid($uuid);
4646
$egg = $server->egg;
4747

48-
return JsonResponse::create([
48+
return new JsonResponse([
4949
'container_image' => $egg->copy_script_container,
5050
'entrypoint' => $egg->copy_script_entry,
5151
'script' => $egg->copy_script_install,

app/Http/Controllers/Base/LocaleController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __invoke(Request $request, string $locale, string $namespace)
3131
{
3232
$data = $this->translator->getLoader()->load($locale, str_replace('.', '/', $namespace));
3333

34-
return JsonResponse::create($data, 200, [
34+
return new JsonResponse($data, 200, [
3535
'E-Tag' => md5(json_encode($data)),
3636
]);
3737
}

app/Http/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Pterodactyl\Http;
44

5+
use Illuminate\Http\Middleware\TrustProxies;
56
use Pterodactyl\Models\ApiKey;
67
use Illuminate\Auth\Middleware\Authorize;
78
use Illuminate\Auth\Middleware\Authenticate;
89
use Pterodactyl\Http\Middleware\TrimStrings;
9-
use Pterodactyl\Http\Middleware\TrustProxies;
1010
use Illuminate\Session\Middleware\StartSession;
1111
use Pterodactyl\Http\Middleware\EncryptCookies;
1212
use Pterodactyl\Http\Middleware\Api\IsValidJson;

app/Http/Middleware/TrustProxies.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"ext-zip": "*",
2020
"aws/aws-sdk-php": "^3.171",
2121
"doctrine/dbal": "~2.13.9",
22-
"fideloper/proxy": "~4.4.1",
2322
"guzzlehttp/guzzle": "~7.4.2",
2423
"hashids/hashids": "~4.1.0",
2524
"laracasts/utilities": "~3.2.1",

0 commit comments

Comments
 (0)