Skip to content

Commit 34844bb

Browse files
authored
Merge pull request #106 from prem-chandar/content_type_gzbr_fix
contentType handled properly
2 parents e6c79dc + 8b0a9cb commit 34844bb

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
@@ -131,14 +131,14 @@ module.exports = CoreObject.extend({
131131
var isBrotliCompressed = brotliCompressedFilePaths.indexOf(filePath) !== -1;
132132

133133
if (isGzipped && path.extname(basePath) === '.gz') {
134-
var basePathUngzipped = path.basename(basePath, '.gz');
134+
var basePathUngzipped = filePath.slice(0, -3);
135135
if (filePaths && filePaths.indexOf(basePathUngzipped) !== -1) {
136136
contentType = mime.getType(basePathUngzipped) || defaultType;
137137
encoding = this._mimeCharsetsLookup(contentType);
138138
}
139139
}
140140
if (isBrotliCompressed) {
141-
var basePathUncompressed = path.basename(basePath, '.br');
141+
var basePathUncompressed = filePath.slice(0, -3);
142142
if (filePaths && filePaths.indexOf(basePathUncompressed) !== -1) {
143143
contentType = mime.getType(basePathUncompressed) || defaultType;
144144
encoding = this._mimeCharsetsLookup(contentType);

0 commit comments

Comments
 (0)