File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,6 +125,11 @@ export class StorageTransport {
125125 callback ?: StorageTransportCallback < T > ,
126126 ) : Promise < void | T > {
127127 const headers = this . #buildRequestHeaders( reqOpts . headers ) ;
128+ if ( reqOpts . headers ) {
129+ Object . entries ( reqOpts . headers ) . forEach ( ( [ key , value ] ) => {
130+ headers . set ( key , value as string ) ;
131+ } ) ;
132+ }
128133 if ( reqOpts [ GCCL_GCS_CMD_KEY ] ) {
129134 headers . set (
130135 'x-goog-api-client' ,
@@ -137,11 +142,6 @@ export class StorageTransport {
137142 this . gaxiosInstance . interceptors . request . add ( inter ) ;
138143 }
139144 }
140- if ( reqOpts . headers ) {
141- Object . entries ( reqOpts . headers ) . forEach ( ( [ key , value ] ) => {
142- headers . set ( key , value as string ) ;
143- } ) ;
144- }
145145
146146 const isDelete = reqOpts . method ?. toUpperCase ( ) === 'DELETE' ;
147147 const urlString = reqOpts . url ?. toString ( ) || '' ;
Original file line number Diff line number Diff line change @@ -59,7 +59,9 @@ function mockAuthorizeRequest(
5959 access_token : 'abc123' ,
6060 } ,
6161) {
62- return nock ( 'https://oauth2.googleapis.com' ) . post ( '/token' ) . reply ( code , data ) ;
62+ return nock ( 'https://oauth2.googleapis.com' )
63+ . post ( '/token' , ( ) => true )
64+ . reply ( code , data ) ;
6365}
6466
6567describe ( 'resumable-upload' , ( ) => {
You can’t perform that action at this time.
0 commit comments