qcos-upload
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -152,3 +152,3 @@ var fs = require("fs"); | ||
function putFile() { | ||
let obj = assign(config.Headers || {}, { | ||
let obj = assign({},config.Headers || {}, { | ||
Bucket: config.Bucket, | ||
@@ -155,0 +155,0 @@ Region: config.Region, |
{ | ||
"name": "qcos-upload", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "cos upload", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# fork自[qcloud-upload](https://github.com/yingye/qcloud-upload); | ||
fix window下使用,分隔符为"\",现已修改为“/”。 | ||
fix window下使用,分隔符为"\\",现已修改为“/”。 | ||
增加两个新选项`clearDistDir`和`setHeaders`。 | ||
# qcloud-upload | ||
@@ -22,6 +24,5 @@ | ||
const setHeaders = (obj)=>{ | ||
const shouldUseGzip = [".js",".css",".gz"]; | ||
const ext = path.parse(obj.Key).ext; | ||
if(shouldUseGzip.indexOf(ext)!=-1){ | ||
obj.ContentEncoding = "gzip"; | ||
const reg = /.*\.(js|css|gz)$/ | ||
if(reg.test(obj.Key)){ | ||
obj.ContentEncoding = "gzip"; | ||
} | ||
@@ -28,0 +29,0 @@ return obj; |
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
107
115375