File tree 1 file changed +14
-9
lines changed 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change 16
16
17
17
import * as firestore from '@google-cloud/firestore' ;
18
18
19
- import type { CallOptions } from 'google-gax' ;
19
+ import type { CallOptions , ClientOptions } from 'google-gax' ;
20
20
import type * as googleGax from 'google-gax' ;
21
21
import type * as googleGaxFallback from 'google-gax/build/src/fallback' ;
22
22
import { Duplex , PassThrough , Transform } from 'stream' ;
@@ -580,14 +580,19 @@ export class Firestore implements firestore.Firestore {
580
580
const grpcModule = this . _settings . grpc ?? require ( 'google-gax' ) . grpc ;
581
581
const sslCreds = grpcModule . credentials . createInsecure ( ) ;
582
582
583
- client = new module . exports . v1 (
584
- {
585
- sslCreds,
586
- ...this . _settings ,
587
- fallback : useFallback ,
588
- } ,
589
- gax
590
- ) ;
583
+ const settings : ClientOptions = {
584
+ sslCreds,
585
+ ...this . _settings ,
586
+ fallback : useFallback ,
587
+ } ;
588
+
589
+ // Since `ssl === false`, if we're using the GAX fallback then
590
+ // also set the `protocol` option for GAX fallback to force http
591
+ if ( useFallback ) {
592
+ settings . protocol = 'http' ;
593
+ }
594
+
595
+ client = new module . exports . v1 ( settings , gax ) ;
591
596
} else {
592
597
client = new module . exports . v1 (
593
598
{
You can’t perform that action at this time.
0 commit comments