From f3fefdefb5bc5a71fc866f4f49ec983d73b56f27 Mon Sep 17 00:00:00 2001 From: mertmit Date: Tue, 17 Oct 2023 12:05:58 +0000 Subject: [PATCH] fix: upload by url to buckets --- packages/nocodb/src/plugins/backblaze/Backblaze.ts | 1 + packages/nocodb/src/plugins/gcs/Gcs.ts | 1 + packages/nocodb/src/plugins/linode/LinodeObjectStorage.ts | 1 + packages/nocodb/src/plugins/mino/Minio.ts | 1 + packages/nocodb/src/plugins/ovhCloud/OvhCloud.ts | 1 + packages/nocodb/src/plugins/s3/S3.ts | 1 + packages/nocodb/src/plugins/scaleway/ScalewayObjectStorage.ts | 1 + packages/nocodb/src/plugins/spaces/Spaces.ts | 1 + packages/nocodb/src/plugins/upcloud/UpoCloud.ts | 1 + packages/nocodb/src/plugins/vultr/Vultr.ts | 1 + 10 files changed, 10 insertions(+) diff --git a/packages/nocodb/src/plugins/backblaze/Backblaze.ts b/packages/nocodb/src/plugins/backblaze/Backblaze.ts index 949bacfd39..ecc6803b40 100644 --- a/packages/nocodb/src/plugins/backblaze/Backblaze.ts +++ b/packages/nocodb/src/plugins/backblaze/Backblaze.ts @@ -54,6 +54,7 @@ export default class Backblaze implements IStorageAdapterV2 { .get(url, { httpAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), httpsAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), + responseType: 'arraybuffer', }) .then((response) => { uploadParams.Body = response.data; diff --git a/packages/nocodb/src/plugins/gcs/Gcs.ts b/packages/nocodb/src/plugins/gcs/Gcs.ts index 34f37c9c5e..0bc7340138 100644 --- a/packages/nocodb/src/plugins/gcs/Gcs.ts +++ b/packages/nocodb/src/plugins/gcs/Gcs.ts @@ -110,6 +110,7 @@ export default class Gcs implements IStorageAdapterV2 { .get(url, { httpAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), httpsAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), + responseType: 'arraybuffer', }) .then((response) => { this.storageClient diff --git a/packages/nocodb/src/plugins/linode/LinodeObjectStorage.ts b/packages/nocodb/src/plugins/linode/LinodeObjectStorage.ts index 29b658f485..eec1276cdb 100644 --- a/packages/nocodb/src/plugins/linode/LinodeObjectStorage.ts +++ b/packages/nocodb/src/plugins/linode/LinodeObjectStorage.ts @@ -53,6 +53,7 @@ export default class LinodeObjectStorage implements IStorageAdapterV2 { .get(url, { httpAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), httpsAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), + responseType: 'arraybuffer', }) .then((response) => { uploadParams.Body = response.data; diff --git a/packages/nocodb/src/plugins/mino/Minio.ts b/packages/nocodb/src/plugins/mino/Minio.ts index b6a493412e..33d875ea82 100644 --- a/packages/nocodb/src/plugins/mino/Minio.ts +++ b/packages/nocodb/src/plugins/mino/Minio.ts @@ -100,6 +100,7 @@ export default class Minio implements IStorageAdapterV2 { .get(url, { httpAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), httpsAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), + responseType: 'arraybuffer', }) .then((response) => { uploadParams.Body = response.data; diff --git a/packages/nocodb/src/plugins/ovhCloud/OvhCloud.ts b/packages/nocodb/src/plugins/ovhCloud/OvhCloud.ts index c2eeaa95cb..42281d01a4 100644 --- a/packages/nocodb/src/plugins/ovhCloud/OvhCloud.ts +++ b/packages/nocodb/src/plugins/ovhCloud/OvhCloud.ts @@ -53,6 +53,7 @@ export default class OvhCloud implements IStorageAdapterV2 { .get(url, { httpAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), httpsAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), + responseType: 'arraybuffer', }) .then((response) => { uploadParams.Body = response.data; diff --git a/packages/nocodb/src/plugins/s3/S3.ts b/packages/nocodb/src/plugins/s3/S3.ts index 5b02391af9..c83180f23b 100644 --- a/packages/nocodb/src/plugins/s3/S3.ts +++ b/packages/nocodb/src/plugins/s3/S3.ts @@ -60,6 +60,7 @@ export default class S3 implements IStorageAdapterV2 { .get(url, { httpAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), httpsAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), + responseType: 'arraybuffer', }) .then((response) => { uploadParams.Body = response.data; diff --git a/packages/nocodb/src/plugins/scaleway/ScalewayObjectStorage.ts b/packages/nocodb/src/plugins/scaleway/ScalewayObjectStorage.ts index 75c2141906..31ea0de26a 100644 --- a/packages/nocodb/src/plugins/scaleway/ScalewayObjectStorage.ts +++ b/packages/nocodb/src/plugins/scaleway/ScalewayObjectStorage.ts @@ -103,6 +103,7 @@ export default class ScalewayObjectStorage implements IStorageAdapterV2 { .get(url, { httpAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), httpsAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), + responseType: 'arraybuffer', }) .then((response) => { uploadParams.Body = response.data; diff --git a/packages/nocodb/src/plugins/spaces/Spaces.ts b/packages/nocodb/src/plugins/spaces/Spaces.ts index 998f6b1597..5cfbd9184b 100644 --- a/packages/nocodb/src/plugins/spaces/Spaces.ts +++ b/packages/nocodb/src/plugins/spaces/Spaces.ts @@ -53,6 +53,7 @@ export default class Spaces implements IStorageAdapterV2 { .get(url, { httpAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), httpsAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), + responseType: 'arraybuffer', }) .then((response) => { uploadParams.Body = response.data; diff --git a/packages/nocodb/src/plugins/upcloud/UpoCloud.ts b/packages/nocodb/src/plugins/upcloud/UpoCloud.ts index 019a5dde1e..8e522f058b 100644 --- a/packages/nocodb/src/plugins/upcloud/UpoCloud.ts +++ b/packages/nocodb/src/plugins/upcloud/UpoCloud.ts @@ -53,6 +53,7 @@ export default class UpoCloud implements IStorageAdapterV2 { .get(url, { httpAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), httpsAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), + responseType: 'arraybuffer', }) .then((response) => { uploadParams.Body = response.data; diff --git a/packages/nocodb/src/plugins/vultr/Vultr.ts b/packages/nocodb/src/plugins/vultr/Vultr.ts index b0f90a5db3..0a4d29a463 100644 --- a/packages/nocodb/src/plugins/vultr/Vultr.ts +++ b/packages/nocodb/src/plugins/vultr/Vultr.ts @@ -53,6 +53,7 @@ export default class Vultr implements IStorageAdapterV2 { .get(url, { httpAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), httpsAgent: useAgent(url, { stopPortScanningByUrlRedirection: true }), + responseType: 'arraybuffer', }) .then((response) => { uploadParams.Body = response.data;