From c3521e022161606c115d8a900040cf2cae190a96 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Mon, 21 Nov 2022 13:15:49 -0700 Subject: [PATCH] api(server): fix undefined header --- app/Repositories/Wings/DaemonFileRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Repositories/Wings/DaemonFileRepository.php b/app/Repositories/Wings/DaemonFileRepository.php index eb3649641..3bd897881 100644 --- a/app/Repositories/Wings/DaemonFileRepository.php +++ b/app/Repositories/Wings/DaemonFileRepository.php @@ -2,6 +2,7 @@ namespace Pterodactyl\Repositories\Wings; +use Illuminate\Support\Arr; use Webmozart\Assert\Assert; use Pterodactyl\Models\Server; use Psr\Http\Message\ResponseInterface; @@ -35,8 +36,7 @@ class DaemonFileRepository extends DaemonRepository throw new DaemonConnectionException($exception); } - $length = (int) $response->getHeader('Content-Length')[0] ?? 0; - + $length = (int) Arr::get($response->getHeader('Content-Length'), 0, 0); if ($notLargerThan && $length > $notLargerThan) { throw new FileSizeTooLargeException(); }