Skip to content

Commit 8b0a9cb

Browse files
committed
contentType handled properly
1 parent ed6f07b commit 8b0a9cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/s3.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ module.exports = CoreObject.extend({
125125
var isBrotliCompressed = brotliCompressedFilePaths.indexOf(filePath) !== -1;
126126

127127
if (isGzipped && path.extname(basePath) === '.gz') {
128-
var basePathUngzipped = path.basename(basePath, '.gz');
128+
var basePathUngzipped = filePath.slice(0, -3);
129129
if (filePaths && filePaths.indexOf(basePathUngzipped) !== -1) {
130130
contentType = mime.lookup(basePathUngzipped);
131131
encoding = mime.charsets.lookup(contentType);
132132
}
133133
}
134134
if (isBrotliCompressed) {
135-
var basePathUncompressed = path.basename(basePath, '.br');
135+
var basePathUncompressed = filePath.slice(0, -3);
136136
if (filePaths && filePaths.indexOf(basePathUncompressed) !== -1) {
137137
contentType = mime.lookup(basePathUncompressed);
138138
encoding = mime.charsets.lookup(contentType);

0 commit comments

Comments
 (0)