File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -4016,8 +4016,8 @@ function submitRequest(params, callback) {
40164016 params . headers [ 'Content-Length' ] = contentLength ;
40174017 }
40184018 } else {
4019- // 非 get 请求的空请求体需补充 content-length = 0
4020- var noContentLengthMethods = [ 'get' ] . includes ( method ) ;
4019+ // 非 get、head 请求的空请求体需补充 content-length = 0
4020+ var noContentLengthMethods = [ 'get' , 'head' ] . includes ( method ) ;
40214021 if ( ! noContentLengthMethods ) {
40224022 params . headers [ 'Content-Length' ] = 0 ;
40234023 }
Original file line number Diff line number Diff line change @@ -4727,7 +4727,7 @@ group('BucketInventory', function () {
47274727
47284728group ( 'Content-Type: false Bug' , function ( ) {
47294729 test ( 'fs.createReadStream 1' , function ( done , assert ) {
4730- var filename = Date . now ( ) + '_1.zip ' ;
4730+ var filename = Date . now ( ) + '_1' ;
47314731 var filepath = path . resolve ( __dirname , filename ) ;
47324732 util . createFile ( filepath , 1 , function ( err ) {
47334733 // 调用方法
@@ -4747,7 +4747,7 @@ group('Content-Type: false Bug', function () {
47474747 } ,
47484748 function ( err , data ) {
47494749 var contentType = data && data . headers [ 'content-type' ] ;
4750- assert . ok ( contentType === 'application/zip ' , '返回了 Content-Type: ' + contentType ) ;
4750+ assert . ok ( contentType === 'application/octet-stream ' , '返回了 Content-Type: ' + contentType ) ;
47514751 fs . unlinkSync ( filepath ) ;
47524752 done ( ) ;
47534753 }
You can’t perform that action at this time.
0 commit comments