File tree 1 file changed +8
-8
lines changed
packages/firestore/src/api
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ interface Gapi {
398
398
export class FirstPartyToken implements Token {
399
399
type = 'FirstParty' as TokenType ;
400
400
user = User . FIRST_PARTY ;
401
- headers = new Map ( ) ;
401
+ private _headers = new Map ( ) ;
402
402
403
403
constructor (
404
404
private readonly gapi : Gapi ,
@@ -426,18 +426,18 @@ export class FirstPartyToken implements Token {
426
426
}
427
427
}
428
428
429
- get authHeaders ( ) : { [ header : string ] : string } {
430
- const headers : { [ header : string ] : string } = {
431
- 'X-Goog-AuthUser' : this . sessionIndex
432
- } ;
429
+ get headers ( ) : Map < string , string > {
430
+ this . _headers . set ( 'X-Goog-AuthUser' , this . sessionIndex ) ;
433
431
// Use array notation to prevent minification
434
432
const authHeaderTokenValue = this . getAuthToken ( ) ;
435
433
if ( authHeaderTokenValue ) {
436
- headers [ 'Authorization' ] = authHeaderTokenValue ;
434
+ this . _headers . set ( 'Authorization' , authHeaderTokenValue ) ;
437
435
}
438
- if ( iamToken ) {
439
- this . headers . set ( 'X-Goog-Iam-Authorization-Token' , iamToken ) ;
436
+ if ( this . iamToken ) {
437
+ this . _headers . set ( 'X-Goog-Iam-Authorization-Token' , this . iamToken ) ;
440
438
}
439
+
440
+ return this . _headers ;
441
441
}
442
442
}
443
443
You can’t perform that action at this time.
0 commit comments