@infurnia/backend-file-storage
Advanced tools
Comparing version 2.13.0 to 2.14.0
@@ -16,3 +16,3 @@ const {Storage} = require('@google-cloud/storage'); | ||
if (content_disposition_attachment) { | ||
await gcs_file.save(file_object, { resumable: false, metadata: { contentDisposition: 'attachment'}}); | ||
await gcs_file.save(file_object, { resumable: false, metadata: { cacheControl: 'public, max-age=864000', contentDisposition: 'attachment'}}); | ||
} | ||
@@ -36,3 +36,3 @@ else { | ||
if(content_disposition_attachment){ | ||
save_res = await gcs_bucket.upload(file_path, {destination: key, resumable: false, metadata: { contentDisposition: 'attachment'}}); | ||
save_res = await gcs_bucket.upload(file_path, {destination: key, resumable: false, metadata: { cacheControl: 'public, max-age=864000', contentDisposition: 'attachment'}}); | ||
} | ||
@@ -54,3 +54,3 @@ else { | ||
if (content_disposition_attachment) { | ||
return this.gcsClient.bucket(bucket_name).file(key).createWriteStream({ metadata: { contentDisposition: 'attachment' }}); | ||
return this.gcsClient.bucket(bucket_name).file(key).createWriteStream({ metadata: { cacheControl: 'public, max-age=864000', contentDisposition: 'attachment' }}); | ||
} | ||
@@ -126,4 +126,5 @@ else { | ||
const gcs_file = this.gcsClient.bucket(bucket_name).file(key); | ||
await gcs_file.download({ destination: destination_path}); | ||
return "OK"; | ||
const res = await gcs_file.download({ destination: destination_path}); | ||
console.log(res); | ||
return res; | ||
} | ||
@@ -130,0 +131,0 @@ catch(err){ |
{ | ||
"name": "@infurnia/backend-file-storage", | ||
"version": "2.13.0", | ||
"version": "2.14.0", | ||
"description": "Storage engine for google cloud storage", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16972
372
1