1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-22 09:02:28 +01:00

api(server): fix undefined header

This commit is contained in:
Matthew Penner 2022-11-21 13:15:49 -07:00
parent 2f4a60c961
commit c3521e0221
No known key found for this signature in database

View File

@ -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();
}