nl_tokens: 获取 Bucket 的 跨域设置
pl_tokens: function getBucketCors ( params , callback ) { submitRequest . call ( this , { Action : 'name/cos:GetBucketCORS' , method : 'GET' , Bucket : params . Bucket , Region : params . Region , headers : params . Headers , action : 'cors' , } , function ( err , data ) { if ( err ) { if ( err . statusCode === 404 && err . error && err . error . Code === 'NoSuchCORSConfiguration' ) { var result = { CORSRules : [ ] , statusCode : err . statusCode , } ; err . headers && ( result . headers = err . <mask> ) ; callback ( null , result ) ; } else { callback ( err ) ; } return ; } var CORSConfiguration = data . CORSConfiguration || { } ; var CORSRules = CORSConfiguration . CORSRules || CORSConfiguration . CORSRule || [ ] ; CORSRules = util . clone ( util . isArray ( CORSRules ) ? CORSRules : [ CORSRules ] ) ; util . each ( CORSRules , function ( rule ) { util . each ( [ 'AllowedOrigin' , 'AllowedHeader' , 'AllowedMethod' , 'ExposeHeader' ] , function ( key , j ) { var sKey = key + 's' ; var val = rule [ sKey ] || rule [ key ] || [ ] ; delete rule [ key ] ; rule [ sKey ] = util . isArray ( val ) ? val : [ val ] ; } ) ; } ) ; callback ( null , { CORSRules : CORSRules , statusCode : data . statusCode , headers : data . headers , } ) ; } ) ; }