1
0
Fork 0
mirror of synced 2024-08-17 11:01:26 +12:00

Attach correct content type to JS files when uploading to object store

This commit is contained in:
Andrew Kingston 2022-08-11 15:25:04 +01:00
parent ed751212eb
commit e8b9a49074

View file

@ -178,6 +178,14 @@ export const streamUpload = async (
const objectStore = ObjectStore(bucketName)
await makeSureBucketExists(objectStore, bucketName)
// Set content type for certain known extensions
if (filename?.endsWith(".js")) {
extra = {
...extra,
ContentType: "application/javascript",
}
}
const params = {
Bucket: sanitizeBucket(bucketName),
Key: sanitizeKey(filename),