api(server): fix undefined header
This commit is contained in:
parent
2f4a60c961
commit
c3521e0221
1 changed files with 2 additions and 2 deletions
|
@ -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 a new issue