@@ -1046,6 +1046,7 @@ function getObject(params, callback) {
10461046 * @param {String } params.GrantRead 赋予被授权者读的权限,格式 x-cos-grant-read: uin=" ",uin=" ",非必须
10471047 * @param {String } params.GrantWrite 赋予被授权者写的权限,格式 x-cos-grant-write: uin=" ",uin=" ",非必须
10481048 * @param {String } params.GrantFullControl 赋予被授权者读写权限,格式 x-cos-grant-full-control: uin=" ",uin=" ",非必须
1049+ * @param {String } params.ServiceSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: "AES256",非必须
10491050 * @param {Function } params.onProgress 上传进度回调函数
10501051 * @param {Function } callback 回调函数,必须
10511052 * @return {Object } err 请求失败的错误,如果请求成功,则为空。
@@ -1069,6 +1070,7 @@ function putObject(params, callback) {
10691070 headers [ 'x-cos-grant-write' ] = params [ 'GrantWrite' ] ;
10701071 headers [ 'x-cos-grant-full-control' ] = params [ 'GrantFullControl' ] ;
10711072 headers [ 'x-cos-storage-class' ] = params [ 'StorageClass' ] ;
1073+ headers [ 'x-cos-server-side-encryption' ] = params [ 'ServiceSideEncryption' ] ;
10721074
10731075 for ( var key in params ) {
10741076 if ( key . indexOf ( 'x-cos-meta-' ) > - 1 ) {
@@ -1325,6 +1327,7 @@ function optionsObject(params, callback) {
13251327 * @param {String } ContentType RFC 2616 中定义的 HTTP 请求内容类型(MIME),例如text/plain
13261328 * @param {String } Expect 请求的特定的服务器行为
13271329 * @param {String } Expires 响应过期的日期和时间
1330+ * @param {String } params.ServiceSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: "AES256",非必须
13281331 * @param {String } ContentLanguage 指定内容语言
13291332 * @param {String } x-cos-meta-* 允许用户自定义的头部信息,将作为 Object 元数据返回。大小限制2K。
13301333 */
@@ -1349,6 +1352,7 @@ function putObjectCopy(params, callback) {
13491352 headers [ 'Content-Type' ] = params [ 'ContentType' ] ;
13501353 headers [ 'Expect' ] = params [ 'Expect' ] ;
13511354 headers [ 'Expires' ] = params [ 'Expires' ] ;
1355+ headers [ 'x-cos-server-side-encryption' ] = params [ 'ServiceSideEncryption' ] ;
13521356
13531357 for ( var key in params ) {
13541358 if ( key . indexOf ( 'x-cos-meta-' ) > - 1 ) {
@@ -1476,6 +1480,7 @@ function deleteMultipleObject(params, callback) {
14761480 * @param {String } params.GrantWrite 赋予被授权者写的权限 ,非必须
14771481 * @param {String } params.GrantFullControl 赋予被授权者读写权限 ,非必须
14781482 * @param {String } params.StorageClass 设置Object的存储级别,枚举值:Standard,Standard_IA,Nearline,非必须
1483+ * @param {String } params.ServiceSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: "AES256",非必须
14791484 * @param {Function } callback 回调函数,必须
14801485 * @return {Object } err 请求失败的错误,如果请求成功,则为空。
14811486 * @return {Object } data 返回的数据
@@ -1494,7 +1499,7 @@ function multipartInit(params, callback) {
14941499 headers [ 'x-cos-grant-write' ] = params [ 'GrantWrite' ] ;
14951500 headers [ 'x-cos-grant-full-control' ] = params [ 'GrantFullControl' ] ;
14961501 headers [ 'x-cos-storage-class' ] = params [ 'StorageClass' ] ;
1497-
1502+ headers [ 'x-cos-server-side-encryption' ] = params [ 'ServiceSideEncryption' ] ;
14981503 for ( var key in params ) {
14991504 if ( key . indexOf ( 'x-cos-meta-' ) > - 1 ) {
15001505 headers [ key ] = params [ key ] ;
0 commit comments