File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3315,9 +3315,16 @@ class File extends ServiceObject<File, FileMetadata> {
33153315 undefined ,
33163316 callback ,
33173317 ) ;
3318- const url = `${ this . storage . apiEndpoint } /${ this . bucket . name } /${ encodeURIComponent ( this . name ) } ` ;
3318+ const url = `https:// ${ this . storage . apiEndpoint } /storage/v1/b/ ${ this . bucket . name } /o /${ encodeURIComponent ( this . name ) } ` ;
33193319
33203320 const gaxios = new Gaxios ( ) ;
3321+ const storageInterceptors = this . storage ?. interceptors || [ ] ;
3322+ const fileInterceptors = this . interceptors || [ ] ;
3323+ const allInterceptors = storageInterceptors . concat ( fileInterceptors ) ;
3324+
3325+ for ( const curInter of allInterceptors ) {
3326+ gaxios . interceptors . request . add ( curInter ) ;
3327+ }
33213328 gaxios
33223329 . request ( {
33233330 method : 'GET' ,
Original file line number Diff line number Diff line change @@ -462,7 +462,7 @@ class Iam {
462462 ? permissions
463463 : [ permissions ] ;
464464
465- const req : any = {
465+ const req : { permissions : string [ ] ; userProject ?: string } = {
466466 permissions : permissionsArray ,
467467 } ;
468468 if ( options . userProject ) {
Original file line number Diff line number Diff line change @@ -3744,7 +3744,7 @@ describe('File', () => {
37443744
37453745 it ( 'should correctly format URL and method in the request' , done => {
37463746 gaxiosStub . resolves ( { data : { } } ) ;
3747- const expectedUrl = `${ file . storage . apiEndpoint } /${ BUCKET . name } /${ encodeURIComponent ( file . name ) } ` ;
3747+ const expectedUrl = `https:// ${ file . storage . apiEndpoint } /storage/v1/b/ ${ BUCKET . name } /o /${ encodeURIComponent ( file . name ) } ` ;
37483748
37493749 file . isPublic ( err => {
37503750 assert . ifError ( err ) ;
You can’t perform that action at this time.
0 commit comments