@@ -951,7 +951,7 @@ describe('test/object.test.js', () => {
951
951
assert . equal ( urlRes . data . toString ( ) , result . content . toString ( ) ) ;
952
952
} ) ;
953
953
954
- it ( 'should signature url with reponse limitation' , async ( ) => {
954
+ it ( 'should signature url with response limitation' , async ( ) => {
955
955
const response = {
956
956
'content-type' : 'xml' ,
957
957
'content-language' : 'zh-cn'
@@ -961,6 +961,30 @@ describe('test/object.test.js', () => {
961
961
assert ( url . indexOf ( 'response-content-language=zh-cn' ) !== - 1 ) ;
962
962
} ) ;
963
963
964
+ it ( 'should signature url with options contains other parameters' , async ( ) => {
965
+ const options = {
966
+ expires : 3600 ,
967
+ subResource : {
968
+ 'x-oss-process' : 'image/resize,w_200' ,
969
+ } ,
970
+ // others parameters
971
+ filename : 'test.js' ,
972
+ testParameters : 'xxx' ,
973
+ } ;
974
+ const imageName = `${ prefix } ali-sdk/oss/nodejs-test-signature-1024x768.png` ;
975
+ const originImagePath = path . join ( __dirname , 'nodejs-1024x768.png' ) ;
976
+ path . join ( __dirname , 'nodejs-processed-w200.png' ) ;
977
+ await store . put ( imageName , originImagePath , {
978
+ mime : 'image/png' ,
979
+ } ) ;
980
+
981
+ const signUrl = store . signatureUrl ( imageName , options ) ;
982
+ const processedKeyword = 'x-oss-process=image%2Fresize%2Cw_200' ;
983
+ assert . equal ( signUrl . match ( processedKeyword ) , processedKeyword ) ;
984
+ const urlRes = await urllib . request ( signUrl ) ;
985
+ assert . equal ( urlRes . status , 200 ) ;
986
+ } ) ;
987
+
964
988
it ( 'should signature url with image processed and get object ok' , async ( ) => {
965
989
const imageName = `${ prefix } ali-sdk/oss/nodejs-test-signature-1024x768.png` ;
966
990
const originImagePath = path . join ( __dirname , 'nodejs-1024x768.png' ) ;
0 commit comments