Skip to content

Commit c3521e0

Browse files
committed
api(server): fix undefined header
1 parent 2f4a60c commit c3521e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/Repositories/Wings/DaemonFileRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Pterodactyl\Repositories\Wings;
44

5+
use Illuminate\Support\Arr;
56
use Webmozart\Assert\Assert;
67
use Pterodactyl\Models\Server;
78
use Psr\Http\Message\ResponseInterface;
@@ -35,8 +36,7 @@ public function getContent(string $path, int $notLargerThan = null): string
3536
throw new DaemonConnectionException($exception);
3637
}
3738

38-
$length = (int) $response->getHeader('Content-Length')[0] ?? 0;
39-
39+
$length = (int) Arr::get($response->getHeader('Content-Length'), 0, 0);
4040
if ($notLargerThan && $length > $notLargerThan) {
4141
throw new FileSizeTooLargeException();
4242
}

0 commit comments

Comments
 (0)