[go: nahoru, domu]

Skip to content

Commit

Permalink
override of gax.routingHeader.fromParams
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDuckworth committed Jul 20, 2023
1 parent f35b164 commit 2fe8e99
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dev/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import {
RECURSIVE_DELETE_MIN_PENDING_OPS,
RecursiveDelete,
} from './recursive-delete';
import {stringify} from 'querystring';

export {
CollectionReference,
Expand Down Expand Up @@ -590,6 +591,21 @@ export class Firestore implements firestore.Firestore {
}
}

// TODO (multi-db) Revert this override of gax.routingHeader.fromParams
// after a permanent fix is applied. See b/292075646
// This override of the routingHeader.fromParams does not
// encode forward slash characters. This is a temporary fix for b/291780066
gax.routingHeader.fromParams = params => {
return stringify(params, undefined, undefined, {
encodeURIComponent: (val: string) => {
return val
.split('/')
.map(component => encodeURIComponent(component))
.join('/');
},
});
};

if (this._settings.ssl === false) {
const grpcModule = this._settings.grpc ?? require('google-gax').grpc;
const sslCreds = grpcModule.credentials.createInsecure();
Expand Down

0 comments on commit 2fe8e99

Please sign in to comment.