File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -667,18 +667,10 @@ export default class StorageFileApi extends BaseApiClient<StorageError> {
667667 if ( options ?. cacheNonce != null ) query . set ( 'cacheNonce' , String ( options . cacheNonce ) )
668668 const queryString = query . toString ( )
669669
670- // When transforms are requested the signed URL must use the render endpoint.
671- // Some storage-api versions return /object/sign/ even for transform requests,
672- // so we normalise the path on the client side.
673- const returnedPath =
674- hasTransform && data . signedURL . includes ( '/object/sign/' )
675- ? data . signedURL . replace ( '/object/sign/' , '/render/image/sign/' )
676- : data . signedURL
677-
678- // `returnedPath` contains a `token` query parameter, so append extra params with `&` only
679- // when we actually have something to add.
670+ // `data.signedURL` contains a `token` query parameter, so append extra params with `&`
671+ // only when we actually have something to add.
680672 const signedUrl = encodeURI (
681- `${ this . url } ${ returnedPath } ${ queryString ? `&${ queryString } ` : '' } `
673+ `${ this . url } ${ data . signedURL } ${ queryString ? `&${ queryString } ` : '' } `
682674 )
683675
684676 return { signedUrl }
Original file line number Diff line number Diff line change @@ -119,18 +119,18 @@ describe('Object API', () => {
119119 } )
120120
121121 expect ( res . error ) . toBeNull ( )
122- expect ( res . data ?. signedUrl ) . toContain ( `${ URL } /render/image/sign/${ bucketName } /${ uploadPath } ` )
122+ expect ( res . data ?. signedUrl ) . toContain ( `/${ bucketName } /${ uploadPath } ` )
123+ expect ( res . data ?. signedUrl ) . toContain ( 'token=' )
123124 } )
124125
125- test ( 'sign url with empty transform object does not use render endpoint' , async ( ) => {
126+ test ( 'sign url with empty transform object uses object endpoint' , async ( ) => {
126127 await storage . from ( bucketName ) . upload ( uploadPath , file )
127128 const res = await storage . from ( bucketName ) . createSignedUrl ( uploadPath , 2000 , {
128129 transform : { } ,
129130 } )
130131
131132 expect ( res . error ) . toBeNull ( )
132133 expect ( res . data ?. signedUrl ) . toContain ( `${ URL } /object/sign/${ bucketName } /${ uploadPath } ` )
133- expect ( res . data ?. signedUrl ) . not . toContain ( '/render/image/sign/' )
134134 } )
135135
136136 test ( 'sign url with custom filename for download' , async ( ) => {
You can’t perform that action at this time.
0 commit comments