File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 179179 * https://github.com/kreait/firebase-php/blob/6.x/src/Firebase/Http/HttpClientOptions.php
180180 */
181181 'timeout ' => env ('FIREBASE_HTTP_CLIENT_TIMEOUT ' ),
182+
183+ 'guzzle_middlewares ' => [
184+
185+ ]
182186 ],
183187 ],
184188 ],
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ protected function configure(string $name): FirebaseProject
123123 $ options = $ options ->withTimeOut ((float ) $ timeout );
124124 }
125125
126+ if ($ middlewares = $ config ['http_client_options ' ]['guzzle_middlewares ' ] ?? null ) {
127+ $ options = $ options ->withGuzzleMiddlewares ($ middlewares );
128+ }
129+
126130 $ factory = $ factory ->withHttpClientOptions ($ options );
127131
128132 return new FirebaseProject ($ factory , $ config );
Original file line number Diff line number Diff line change 44
55namespace Kreait \Laravel \Firebase \Tests ;
66
7+ use GuzzleHttp \RetryMiddleware ;
78use Kreait \Firebase ;
89use Kreait \Firebase \Exception \InvalidArgumentException ;
910use Kreait \Firebase \Factory ;
@@ -201,6 +202,7 @@ public function http_client_options_can_be_configured(): void
201202 $ projectName = $ this ->app ->config ->get ('firebase.default ' );
202203 $ this ->app ->config ->set ('firebase.projects. ' . $ projectName . '.http_client_options.proxy ' , 'proxy.domain.tld ' );
203204 $ this ->app ->config ->set ('firebase.projects. ' . $ projectName . '.http_client_options.timeout ' , 1.23 );
205+ $ this ->app ->config ->set ('firebase.projects. ' . $ projectName . '.http_client_options.guzzle_middlewares ' , [RetryMiddleware::class]);
204206
205207 $ factory = $ this ->factoryForProject ($ projectName );
206208
@@ -209,6 +211,7 @@ public function http_client_options_can_be_configured(): void
209211
210212 $ this ->assertSame ('proxy.domain.tld ' , $ httpClientOptions ->proxy ());
211213 $ this ->assertSame (1.23 , $ httpClientOptions ->timeout ());
214+ $ this ->assertSame ([RetryMiddleware::class], $ httpClientOptions ->guzzleMiddlewares ());
212215 }
213216
214217 /**
You can’t perform that action at this time.
0 commit comments