@@ -120,11 +120,11 @@ module.exports = CoreObject.extend({
120
120
var expires = options . expires ;
121
121
var serverSideEncryption = options . serverSideEncryption ;
122
122
123
- mime . default_type = options . defaultMimeType || mime . getType ( 'bin' ) ;
123
+ var defaultType = options . defaultMimeType || mime . getType ( 'bin' ) ;
124
124
125
125
var basePath = path . join ( cwd , filePath ) ;
126
126
var data = fs . readFileSync ( basePath ) ;
127
- var contentType = mime . getType ( basePath ) ;
127
+ var contentType = mime . getType ( basePath ) || defaultType ;
128
128
var encoding = this . _mimeCharsetsLookup ( contentType ) ;
129
129
var key = prefix === '' ? filePath : [ prefix , filePath ] . join ( '/' ) ;
130
130
var isGzipped = gzippedFilePaths . indexOf ( filePath ) !== - 1 ;
@@ -133,14 +133,14 @@ module.exports = CoreObject.extend({
133
133
if ( isGzipped && path . extname ( basePath ) === '.gz' ) {
134
134
var basePathUngzipped = path . basename ( basePath , '.gz' ) ;
135
135
if ( filePaths && filePaths . indexOf ( basePathUngzipped ) !== - 1 ) {
136
- contentType = mime . getType ( basePathUngzipped ) ;
136
+ contentType = mime . getType ( basePathUngzipped ) || defaultType ;
137
137
encoding = this . _mimeCharsetsLookup ( contentType ) ;
138
138
}
139
139
}
140
140
if ( isBrotliCompressed ) {
141
141
var basePathUncompressed = path . basename ( basePath , '.br' ) ;
142
142
if ( filePaths && filePaths . indexOf ( basePathUncompressed ) !== - 1 ) {
143
- contentType = mime . getType ( basePathUncompressed ) ;
143
+ contentType = mime . getType ( basePathUncompressed ) || defaultType ;
144
144
encoding = this . _mimeCharsetsLookup ( contentType ) ;
145
145
}
146
146
}
0 commit comments