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:
parent
2f4a60c961
commit
c3521e0221
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user