@@ -1373,7 +1373,7 @@ group('BucketCors', function () {
13731373 var CORSRules = [ {
13741374 "AllowedOrigins" : [ "*" ] ,
13751375 "AllowedMethods" : [ "GET" , "POST" , "PUT" , "DELETE" , "HEAD" ] ,
1376- "AllowedHeaders" : [ "*" ] ,
1376+ "AllowedHeaders" : [ "*" , 'test-' + Date . now ( ) . toString ( 36 ) ] ,
13771377 "ExposeHeaders" : [ "ETag" , "Content-Length" , "x-cos-acl" , "x-cos-version-id" , "x-cos-request-id" , "x-cos-delete-marker" , "x-cos-server-side-encryption" ] ,
13781378 "MaxAgeSeconds" : "5"
13791379 } ] ;
@@ -1408,8 +1408,7 @@ group('BucketCors', function () {
14081408 } ) ;
14091409 } ) ;
14101410 test ( 'putBucketCors(),getBucketCors()' , function ( done , assert ) {
1411- CORSRules [ 0 ] . AllowedHeaders [ CORSRules [ 0 ] . AllowedHeaders . length - 1 ] =
1412- 'test-' + Date . now ( ) . toString ( 36 ) ;
1411+ CORSRules [ 0 ] . AllowedHeaders [ 1 ] = 'test-' + Date . now ( ) . toString ( 36 ) ;
14131412 cos . putBucketCors ( {
14141413 Bucket : config . Bucket ,
14151414 Region : config . Region ,
@@ -1430,8 +1429,7 @@ group('BucketCors', function () {
14301429 } ) ;
14311430 } ) ;
14321431 test ( 'putBucketCors() old' , function ( done , assert ) {
1433- var testVal = 'test-' + Date . now ( ) . toString ( 36 ) ;
1434- CORSRules [ 0 ] . AllowedHeaders . push ( testVal ) ;
1432+ CORSRules [ 0 ] . AllowedHeaders [ 1 ] = 'test-' + Date . now ( ) . toString ( 36 ) ;
14351433 cos . putBucketCors ( {
14361434 Bucket : config . Bucket ,
14371435 Region : config . Region ,
@@ -1452,8 +1450,7 @@ group('BucketCors', function () {
14521450 } ) ;
14531451 } ) ;
14541452 test ( 'putBucketCors() old' , function ( done , assert ) {
1455- CORSRules [ 0 ] . AllowedHeaders [ CORSRules [ 0 ] . AllowedHeaders . length - 1 ] =
1456- 'test-' + Date . now ( ) . toString ( 36 ) ;
1453+ CORSRules [ 0 ] . AllowedHeaders [ 1 ] = 'test-' + Date . now ( ) . toString ( 36 ) ;
14571454 cos . putBucketCors ( {
14581455 Bucket : config . Bucket ,
14591456 Region : config . Region ,
0 commit comments