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 1
1
---
2
- " @firebase/app-check " : patch
3
2
" @firebase/auth " : patch
4
3
" @firebase/data-connect " : patch
5
4
" @firebase/database-compat " : patch
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ export class WebChannelConnection extends RestConnection {
72
72
url : string ,
73
73
headers : StringMap ,
74
74
body : Req ,
75
- _isUsingEmulator : boolean
75
+ _forwardCredentials : boolean
76
76
) : Promise < Resp > {
77
77
const streamId = generateUniqueDebugId ( ) ;
78
78
return new Promise ( ( resolve : Resolver < Resp > , reject : Rejecter ) => {
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
18
- import { isCloudWorkstation } from '@firebase/util' ;
19
-
20
18
import { Token } from '../../api/credentials' ;
21
19
import { Stream } from '../../remote/connection' ;
22
20
import { RestConnection } from '../../remote/rest_connection' ;
@@ -41,7 +39,7 @@ export class FetchConnection extends RestConnection {
41
39
url : string ,
42
40
headers : StringMap ,
43
41
body : Req ,
44
- isUsingEmulator : boolean
42
+ forwardCredentials : boolean
45
43
) : Promise < Resp > {
46
44
const requestJson = JSON . stringify ( body ) ;
47
45
let response : Response ;
@@ -52,7 +50,7 @@ export class FetchConnection extends RestConnection {
52
50
headers,
53
51
body : requestJson
54
52
} ;
55
- if ( isCloudWorkstation ( new URL ( url ) . host ) && isUsingEmulator ) {
53
+ if ( forwardCredentials ) {
56
54
fetchArgs . credentials = 'include' ;
57
55
}
58
56
response = await fetch ( url , fetchArgs ) ;
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
18
+ import { isCloudWorkstation } from '@firebase/util' ;
19
+
18
20
import { SDK_VERSION } from '../../src/core/version' ;
19
21
import { Token } from '../api/credentials' ;
20
22
import {
@@ -98,12 +100,15 @@ export abstract class RestConnection implements Connection {
98
100
} ;
99
101
this . modifyHeadersForRequest ( headers , authToken , appCheckToken ) ;
100
102
103
+ const { host } = new URL ( url ) ;
104
+ const forwardCredentials =
105
+ isCloudWorkstation ( host ) ;
101
106
return this . performRPCRequest < Req , Resp > (
102
107
rpcName ,
103
108
url ,
104
109
headers ,
105
110
req ,
106
- this . databaseInfo . isUsingEmulator
111
+ forwardCredentials
107
112
) . then (
108
113
response => {
109
114
logDebug ( LOG_TAG , `Received RPC '${ rpcName } ' ${ streamId } : ` , response ) ;
@@ -186,7 +191,7 @@ export abstract class RestConnection implements Connection {
186
191
url : string ,
187
192
headers : StringMap ,
188
193
body : Req ,
189
- isUsingEmulator : boolean
194
+ _forwardCredentials : boolean
190
195
) : Promise < Resp > ;
191
196
192
197
private makeUrl ( rpcName : string , path : string ) : string {
You can’t perform that action at this time.
0 commit comments