From ae1753a654a4520fc144c25583d93fda81b46ad5 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 3 Jun 2021 21:33:44 +0100 Subject: [PATCH] set content type on client lib upload --- packages/auth/src/objectStore/index.js | 3 ++- .../src/api/controllers/static/templates/BudibaseApp.svelte | 5 ++--- packages/server/src/utilities/fileSystem/newApp.js | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/auth/src/objectStore/index.js b/packages/auth/src/objectStore/index.js index a157332ae5..80875fdfee 100644 --- a/packages/auth/src/objectStore/index.js +++ b/packages/auth/src/objectStore/index.js @@ -159,7 +159,7 @@ exports.upload = async ({ * Similar to the upload function but can be used to send a file stream * through to the object store. */ -exports.streamUpload = async (bucketName, filename, stream) => { +exports.streamUpload = async (bucketName, filename, stream, extra = {}) => { const objectStore = exports.ObjectStore(bucketName) await exports.makeSureBucketExists(objectStore, bucketName) @@ -167,6 +167,7 @@ exports.streamUpload = async (bucketName, filename, stream) => { Bucket: sanitizeBucket(bucketName), Key: sanitizeKey(filename), Body: stream, + ...extra, } return objectStore.upload(params).promise() } diff --git a/packages/server/src/api/controllers/static/templates/BudibaseApp.svelte b/packages/server/src/api/controllers/static/templates/BudibaseApp.svelte index b73cfc6a3e..f73f79c096 100644 --- a/packages/server/src/api/controllers/static/templates/BudibaseApp.svelte +++ b/packages/server/src/api/controllers/static/templates/BudibaseApp.svelte @@ -31,7 +31,6 @@ margin: 0; padding: 0; } - *, *:before, *:after { @@ -41,9 +40,9 @@ - - diff --git a/packages/server/src/utilities/fileSystem/newApp.js b/packages/server/src/utilities/fileSystem/newApp.js index 22113757c9..735f0d523e 100644 --- a/packages/server/src/utilities/fileSystem/newApp.js +++ b/packages/server/src/utilities/fileSystem/newApp.js @@ -30,5 +30,7 @@ exports.uploadClientLibrary = async appId => { const sourcepath = require.resolve("@budibase/client") const destPath = join(appId, "budibase-client.js") - await streamUpload(BUCKET_NAME, destPath, fs.createReadStream(sourcepath)) + await streamUpload(BUCKET_NAME, destPath, fs.createReadStream(sourcepath), { + ContentType: "application/javascript", + }) }