Skip to content

Commit

Permalink
contentType handled properly
Browse files Browse the repository at this point in the history
  • Loading branch information
premchandars committed May 21, 2018
1 parent ed6f07b commit 8b0a9cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ module.exports = CoreObject.extend({
var isBrotliCompressed = brotliCompressedFilePaths.indexOf(filePath) !== -1;

if (isGzipped && path.extname(basePath) === '.gz') {
var basePathUngzipped = path.basename(basePath, '.gz');
var basePathUngzipped = filePath.slice(0, -3);
if (filePaths && filePaths.indexOf(basePathUngzipped) !== -1) {
contentType = mime.lookup(basePathUngzipped);
encoding = mime.charsets.lookup(contentType);
}
}
if (isBrotliCompressed) {
var basePathUncompressed = path.basename(basePath, '.br');
var basePathUncompressed = filePath.slice(0, -3);
if (filePaths && filePaths.indexOf(basePathUncompressed) !== -1) {
contentType = mime.lookup(basePathUncompressed);
encoding = mime.charsets.lookup(contentType);
Expand Down

0 comments on commit 8b0a9cb

Please sign in to comment.