File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 11---
2- " @firebase/app-check " : patch
32" @firebase/auth " : patch
43" @firebase/data-connect " : patch
54" @firebase/database-compat " : patch
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ export class WebChannelConnection extends RestConnection {
7272 url : string ,
7373 headers : StringMap ,
7474 body : Req ,
75- _isUsingEmulator : boolean
75+ _forwardCredentials : boolean
7676 ) : Promise < Resp > {
7777 const streamId = generateUniqueDebugId ( ) ;
7878 return new Promise ( ( resolve : Resolver < Resp > , reject : Rejecter ) => {
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18- import { isCloudWorkstation } from '@firebase/util' ;
19-
2018import { Token } from '../../api/credentials' ;
2119import { Stream } from '../../remote/connection' ;
2220import { RestConnection } from '../../remote/rest_connection' ;
@@ -41,7 +39,7 @@ export class FetchConnection extends RestConnection {
4139 url : string ,
4240 headers : StringMap ,
4341 body : Req ,
44- isUsingEmulator : boolean
42+ forwardCredentials : boolean
4543 ) : Promise < Resp > {
4644 const requestJson = JSON . stringify ( body ) ;
4745 let response : Response ;
@@ -52,7 +50,7 @@ export class FetchConnection extends RestConnection {
5250 headers,
5351 body : requestJson
5452 } ;
55- if ( isCloudWorkstation ( new URL ( url ) . host ) && isUsingEmulator ) {
53+ if ( forwardCredentials ) {
5654 fetchArgs . credentials = 'include' ;
5755 }
5856 response = await fetch ( url , fetchArgs ) ;
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18+ import { isCloudWorkstation } from '@firebase/util' ;
19+
1820import { SDK_VERSION } from '../../src/core/version' ;
1921import { Token } from '../api/credentials' ;
2022import {
@@ -98,12 +100,15 @@ export abstract class RestConnection implements Connection {
98100 } ;
99101 this . modifyHeadersForRequest ( headers , authToken , appCheckToken ) ;
100102
103+ const { host } = new URL ( url ) ;
104+ const forwardCredentials =
105+ isCloudWorkstation ( host ) ;
101106 return this . performRPCRequest < Req , Resp > (
102107 rpcName ,
103108 url ,
104109 headers ,
105110 req ,
106- this . databaseInfo . isUsingEmulator
111+ forwardCredentials
107112 ) . then (
108113 response => {
109114 logDebug ( LOG_TAG , `Received RPC '${ rpcName } ' ${ streamId } : ` , response ) ;
@@ -186,7 +191,7 @@ export abstract class RestConnection implements Connection {
186191 url : string ,
187192 headers : StringMap ,
188193 body : Req ,
189- isUsingEmulator : boolean
194+ _forwardCredentials : boolean
190195 ) : Promise < Resp > ;
191196
192197 private makeUrl ( rpcName : string , path : string ) : string {
You can’t perform that action at this time.
0 commit comments