File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,16 @@ describe('Cos', () => {
7979 expect ( data ) . toMatch ( / S e r v e r l e s s \s F r a m e w o r k / gi) ;
8080 } ) ;
8181
82+ test ( 'should Cos getObjectUrl success' , async ( ) => {
83+ const res = await cos . getObjectUrl ( {
84+ bucket,
85+ object : 'index.html' ,
86+ method : 'GET' ,
87+ } ) ;
88+
89+ expect ( res ) . toMatch ( / h t t p / ) ;
90+ } ) ;
91+
8292 test ( 'should deploy website success' , async ( ) => {
8393 const res = await cos . website ( websiteInputs ) ;
8494
Original file line number Diff line number Diff line change @@ -431,7 +431,7 @@ export default class Cos {
431431
432432 async getObjectUrl ( inputs : CosGetObjectUrlInputs = { } ) {
433433 try {
434- const { Url } = await this . cosClient . getObjectUrl ( {
434+ const res = await this . cosClient . getObjectUrl ( {
435435 Bucket : inputs . bucket ! ,
436436 Region : this . region ,
437437 Key : inputs . object ! ,
@@ -442,7 +442,8 @@ export default class Cos {
442442 // default is sign url
443443 Sign : inputs . sign === false ? false : true ,
444444 } ) ;
445- return Url ;
445+ // FIXME: Fuck you Cos SDK, res is not an object;
446+ return ( res as unknown ) as string ;
446447 } catch ( err ) {
447448 throw constructCosError ( `API_COS_getObjectUrl` , err ) ;
448449 }
You can’t perform that action at this time.
0 commit comments