google-cloud-bucket
Advanced tools
Comparing version 0.15.1 to 0.15.2
@@ -5,2 +5,11 @@ # Changelog | ||
### [0.15.2](https://github.com/nicolasdao/google-cloud-bucket/compare/v0.15.1...v0.15.2) (2019-10-27) | ||
### Bug Fixes | ||
* Cannot set the 'Cache-Control' header when uploading file to bucket ([18fb1dc](https://github.com/nicolasdao/google-cloud-bucket/commit/18fb1dc)) | ||
### [0.15.1](https://github.com/nicolasdao/google-cloud-bucket/compare/v0.15.0...v0.15.1) (2019-10-27) | ||
@@ -7,0 +16,0 @@ |
{ | ||
"name": "google-cloud-bucket", | ||
"version": "0.15.1", | ||
"version": "0.15.2", | ||
"description": "Nodejs package to manage Google Cloud Buckets and its objects.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -106,4 +106,5 @@ /** | ||
const v = headers[header] | ||
const keyValue = typeof(v) == 'string' ? `"${header}": "${v}"` : `"${header}": ${v}` | ||
if (_isStdHeader(header)) | ||
const stdHeader = _getStdHeader(header) | ||
const keyValue = typeof(v) == 'string' ? `"${stdHeader || header}": "${v}"` : `"${stdHeader || header}": ${v}` | ||
if (stdHeader) | ||
acc.std.push(keyValue) | ||
@@ -669,10 +670,23 @@ else | ||
const _isStdHeader = header => | ||
header == 'cacheControl' | ||
|| header == 'contentDisposition' | ||
|| header == 'contentEncoding' | ||
|| header == 'contentLanguage' | ||
|| header == 'contentType' | ||
|| header == 'eventBasedHold' | ||
|| header == 'temporaryHold' | ||
const _getStdHeader = header => { | ||
if (!header) | ||
return null | ||
const h = header.toLowerCase().replace(/-/g,'') | ||
if (h == 'cachecontrol') | ||
return 'cacheControl' | ||
else if (h == 'contentdisposition') | ||
return 'contentDisposition' | ||
else if (h == 'contentencoding') | ||
return 'contentEncoding' | ||
else if (h == 'contentlanguage') | ||
return 'contentLanguage' | ||
else if (h == 'contenttype') | ||
return 'contentType' | ||
else if (h == 'eventbasedhold') | ||
return 'eventBasedHold' | ||
else if (h == 'temporaryhold') | ||
return 'temporaryHold' | ||
else | ||
return null | ||
} | ||
@@ -708,4 +722,5 @@ // Doc: https://cloud.google.com/storage/docs/json_api/v1/objects/update | ||
metaKeys.forEach(key => { | ||
if (_isStdHeader(key)) | ||
data[key] = meta[key] | ||
const stdKey = _getStdHeader(key) | ||
if (stdKey) | ||
data[stdKey] = meta[key] | ||
else { | ||
@@ -712,0 +727,0 @@ if (!data.metadata) |
Sorry, the diff of this file is not supported yet
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
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
144308
1948