Comparing version 7.0.6 to 7.0.7
@@ -49,2 +49,3 @@ /* | ||
exports.readableStream = readableStream; | ||
exports.insertContentType = insertContentType; | ||
exports.prependXAMZMeta = prependXAMZMeta; | ||
@@ -362,2 +363,17 @@ exports.isAmzHeader = isAmzHeader; | ||
// Process metadata to insert appropriate value to `content-type` attribute | ||
function insertContentType(metaData, filePath) { | ||
// check if content-type attribute present in metaData | ||
for (var key in metaData) { | ||
if (key.toLowerCase() === 'content-type') { | ||
return metaData; | ||
} | ||
} | ||
// if `content-type` attribute is not present in metadata, | ||
// then infer it from the extension in filePath | ||
metaData['content-type'] = probeContentType(filePath); | ||
return metaData; | ||
} | ||
// Function prepends metadata with the appropriate prefix if it is not already on | ||
@@ -364,0 +380,0 @@ |
@@ -29,5 +29,11 @@ /* | ||
var metaData = { | ||
'Content-Type': 'application/octet-stream', | ||
'X-Amz-Meta-Testing': 1234, | ||
'example': 5678 | ||
} | ||
// Put a file in bucket my-bucketname. | ||
var file = 'my-testfile' | ||
s3Client.fPutObject('my-bucketname', 'my-objectname', file, 'application/octet-stream', function(e) { | ||
s3Client.fPutObject('my-bucketname', 'my-objectname', file, metaData, function(e) { | ||
if (e) { | ||
@@ -34,0 +40,0 @@ return console.log(e) |
{ | ||
"name": "minio", | ||
"version": "7.0.6", | ||
"version": "7.0.7", | ||
"description": "S3 Compatible Cloud Storage client", | ||
@@ -5,0 +5,0 @@ "main": "./dist/main/minio.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
563037
5102