diff --git a/packages/nocodb/src/modules/jobs/jobs/thumbnail-generator/thumbnail-generator.processor.ts b/packages/nocodb/src/modules/jobs/jobs/thumbnail-generator/thumbnail-generator.processor.ts index 292b5a77e9..5628799321 100644 --- a/packages/nocodb/src/modules/jobs/jobs/thumbnail-generator/thumbnail-generator.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/thumbnail-generator/thumbnail-generator.processor.ts @@ -3,6 +3,7 @@ import { Readable } from 'stream'; import { Process, Processor } from '@nestjs/bull'; import { Job } from 'bull'; import { Logger } from '@nestjs/common'; +import slash from 'slash'; import type { IStorageAdapterV2 } from 'nc-plugin'; import type { AttachmentResType } from 'nocodb-sdk'; import type { ThumbnailGeneratorJobData } from '~/interface/Jobs'; @@ -102,7 +103,7 @@ export class ThumbnailGeneratorProcessor { .toBuffer(); await (storageAdapter as any).fileCreateByStream( - thumbnailPath, + slash(thumbnailPath), Readable.from(resizedImage), { mimetype: 'image/jpeg', diff --git a/packages/nocodb/src/plugins/mino/Minio.ts b/packages/nocodb/src/plugins/mino/Minio.ts index 8eaef8ea54..26f2933d18 100644 --- a/packages/nocodb/src/plugins/mino/Minio.ts +++ b/packages/nocodb/src/plugins/mino/Minio.ts @@ -123,7 +123,7 @@ export default class Minio implements IStorageAdapterV2 { }, }; - const responseUrl = this.upload(uploadParams); + const responseUrl = await this.upload(uploadParams); return { url: responseUrl, @@ -137,7 +137,7 @@ export default class Minio implements IStorageAdapterV2 { metaData: { [key: string]: string | number }; }): Promise { try { - this.minioClient.putObject( + await this.minioClient.putObject( this.input.bucket, uploadParams.Key, uploadParams.Body, diff --git a/packages/nocodb/src/plugins/mino/index.ts b/packages/nocodb/src/plugins/mino/index.ts index 3cb319a5ce..a25a65cad6 100644 --- a/packages/nocodb/src/plugins/mino/index.ts +++ b/packages/nocodb/src/plugins/mino/index.ts @@ -55,7 +55,7 @@ const config: XcPluginConfig = { label: 'Use SSL', placeholder: 'Use SSL', type: XcType.Checkbox, - required: true, + required: false, }, ], actions: [ diff --git a/packages/nocodb/src/services/attachments.service.ts b/packages/nocodb/src/services/attachments.service.ts index 48968958f8..25fee05caf 100644 --- a/packages/nocodb/src/services/attachments.service.ts +++ b/packages/nocodb/src/services/attachments.service.ts @@ -198,8 +198,18 @@ export class AttachmentsService { param.urls?.map?.((urlMeta) => async () => { try { const { url, fileName: _fileName } = urlMeta; - const response = await axios.head(url, { maxRedirects: 5 }); - const finalUrl = response.request.res.responseUrl || url; + + let mimeType, + response, + size, + finalUrl = url; + + if (!url.startsWith('data:')) { + response = await axios.head(url, { maxRedirects: 5 }); + mimeType = response.headers['content-type']?.split(';')[0]; + size = response.headers['content-length']; + finalUrl = response.request.res.responseUrl; + } const parsedUrl = Url.parse(finalUrl, true); const decodedPath = decodeURIComponent(parsedUrl.pathname); @@ -209,9 +219,6 @@ export class AttachmentsService { 5, )}${path.extname(fileNameWithExt)}`; - let mimeType = response.headers['content-type']?.split(';')[0]; - const size = response.headers['content-length']; - if (!mimeType) { mimeType = mimetypes[path.extname(fileNameWithExt).slice(1)]; }