This repository was archived by the owner on Mar 4, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717import * as firestore from '@google-cloud/firestore' ;
1818
19- import type { CallOptions } from 'google-gax' ;
19+ import type { CallOptions , ClientOptions } from 'google-gax' ;
2020import type * as googleGax from 'google-gax' ;
2121import type * as googleGaxFallback from 'google-gax/build/src/fallback' ;
2222import { Duplex , PassThrough , Transform } from 'stream' ;
@@ -580,14 +580,19 @@ export class Firestore implements firestore.Firestore {
580580 const grpcModule = this . _settings . grpc ?? require ( 'google-gax' ) . grpc ;
581581 const sslCreds = grpcModule . credentials . createInsecure ( ) ;
582582
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 ) ;
591596 } else {
592597 client = new module . exports . v1 (
593598 {
You can’t perform that action at this time.
0 commit comments