Skip to content

Commit

Permalink
fix(fPutObject): remove metadata mutation (#815)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsOstad authored and kannappanr committed Nov 22, 2019
1 parent 70f012e commit c5d206e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,9 @@ export function insertContentType(metaData, filePath) {
}
// if `content-type` attribute is not present in metadata,
// then infer it from the extension in filePath
metaData['content-type'] = probeContentType(filePath)
return metaData
var newMetadata = Object.assign({}, metaData)
newMetadata['content-type'] = probeContentType(filePath)
return newMetadata
}

// Function prepends metadata with the appropriate prefix if it is not already on
Expand Down
2 changes: 1 addition & 1 deletion src/main/minio.js
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ export class Client {
}

// Inserts correct `content-type` attribute based on metaData and filePath
insertContentType(metaData, filePath)
metaData = insertContentType(metaData, filePath)

//Updates metaData to have the correct prefix if needed
metaData = prependXAMZMeta(metaData)
Expand Down

0 comments on commit c5d206e

Please sign in to comment.