Merge pull request #2178 from pterodactyl/feature/decompress

Fix empty request body to wings when decompressing a file
This commit is contained in:
Dane Everitt 2020-07-15 18:46:44 -07:00 committed by GitHub
commit 3b80597899
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View file

@ -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,
],

View file

@ -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;
},
});