nl_tokens: Options Object请求实现跨域访问的预请求。即发出一个 OPTIONS 请求给服务器以确认是否可以进行跨域操作。
pl_tokens: function optionsObject ( params , callback ) { var headers = params . Headers ; headers [ 'Origin' ] = params [ 'Origin' ] ; headers [ 'Access-Control-Request-Method' ] = params [ 'AccessControlRequestMethod' ] ; <mask> [ 'Access-Control-Request-Headers' ] = params [ 'AccessControlRequestHeaders' ] ; submitRequest . call ( this , { Action : 'name/cos:OptionsObject' , method : 'OPTIONS' , Bucket : params . Bucket , Region : params . Region , Key : params . Key , headers : headers , } , function ( err , data ) { if ( err ) { if ( err . statusCode && err . statusCode === 403 ) { return callback ( null , { OptionsForbidden : true , statusCode : err . statusCode } ) ; } return callback ( err ) ; } var headers = data . headers || { } ; callback ( null , { AccessControlAllowOrigin : headers [ 'access-control-allow-origin' ] , AccessControlAllowMethods : headers [ 'access-control-allow-methods' ] , AccessControlAllowHeaders : headers [ 'access-control-allow-headers' ] , AccessControlExposeHeaders : headers [ 'access-control-expose-headers' ] , AccessControlMaxAge : headers [ 'access-control-max-age' ] , statusCode : data . statusCode , headers : data . headers , } ) ; } ) ; }