Skip to content

Commit 3b80597

Browse files
authored
Merge pull request pterodactyl#2178 from pterodactyl/feature/decompress
Fix empty request body to wings when decompressing a file
2 parents 1a6669a + df385ce commit 3b80597

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

app/Repositories/Wings/DaemonFileRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function decompressFile(?string $root, string $file): ResponseInterface
256256
return $this->getHttpClient()->post(
257257
sprintf('/api/servers/%s/files/decompress', $this->server->uuid),
258258
[
259-
'json ' => [
259+
'json' => [
260260
'root' => $root ?? '/',
261261
'file' => $file,
262262
],

resources/scripts/api/transformers.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,17 @@ export const rawDataToFileObject = (data: FractalResponseData): FileObject => ({
2626

2727
isArchiveType: function () {
2828
return this.isFile && [
29-
'application/zip',
30-
'application/gzip',
31-
'application/x-tar',
29+
'application/vnd.rar', // .rar
30+
'application/x-rar-compressed', // .rar (2)
31+
'application/x-tar', // .tar
32+
'application/x-br', // .tar.br
33+
'application/x-bzip2', // .tar.bz2, .bz2
34+
'application/gzip', // .tar.gz, .gz
35+
'application/x-lzip', // .tar.lz4, .lz4 (not sure if this mime type is correct)
36+
'application/x-sz', // .tar.sz, .sz (not sure if this mime type is correct)
37+
'application/x-xz', // .tar.xz, .xz
38+
'application/zstd', // .tar.zst, .zst
39+
'application/zip', // .zip
3240
].indexOf(this.mimetype) >= 0;
3341
},
3442
});

0 commit comments

Comments
 (0)