From b6e31096f0b35fc03f752926beb038cdad2b5a1a Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Wed, 15 Jul 2020 12:29:52 -0600 Subject: [PATCH 1/2] Fix empty request body to wings when decompressing a file --- app/Repositories/Wings/DaemonFileRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Repositories/Wings/DaemonFileRepository.php b/app/Repositories/Wings/DaemonFileRepository.php index 3a605ea94..177f22afd 100644 --- a/app/Repositories/Wings/DaemonFileRepository.php +++ b/app/Repositories/Wings/DaemonFileRepository.php @@ -256,7 +256,7 @@ class DaemonFileRepository extends DaemonRepository return $this->getHttpClient()->post( sprintf('/api/servers/%s/files/decompress', $this->server->uuid), [ - 'json ' => [ + 'json' => [ 'root' => $root ?? '/', 'file' => $file, ], From df385cef3ae9335f401cc082256aa089563bb350 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Wed, 15 Jul 2020 13:09:45 -0600 Subject: [PATCH 2/2] Add additional mimetypes to check if a file is an archive --- resources/scripts/api/transformers.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/resources/scripts/api/transformers.ts b/resources/scripts/api/transformers.ts index c8676bdac..4548c4b1e 100644 --- a/resources/scripts/api/transformers.ts +++ b/resources/scripts/api/transformers.ts @@ -26,9 +26,17 @@ export const rawDataToFileObject = (data: FractalResponseData): FileObject => ({ isArchiveType: function () { return this.isFile && [ - 'application/zip', - 'application/gzip', - 'application/x-tar', + 'application/vnd.rar', // .rar + 'application/x-rar-compressed', // .rar (2) + 'application/x-tar', // .tar + 'application/x-br', // .tar.br + 'application/x-bzip2', // .tar.bz2, .bz2 + 'application/gzip', // .tar.gz, .gz + 'application/x-lzip', // .tar.lz4, .lz4 (not sure if this mime type is correct) + 'application/x-sz', // .tar.sz, .sz (not sure if this mime type is correct) + 'application/x-xz', // .tar.xz, .xz + 'application/zstd', // .tar.zst, .zst + 'application/zip', // .zip ].indexOf(this.mimetype) >= 0; }, });