File tree Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -157,15 +157,14 @@ export class Database implements FirebaseService {
157
157
validateUrl ( apiName , 1 , parsedURL ) ;
158
158
159
159
const repoInfo = parsedURL . repoInfo ;
160
- const expectedHost = this . repo_ . originalHost ;
161
- if ( repoInfo . host !== expectedHost ) {
160
+ if ( ! repoInfo . isCustomHost ( ) && repoInfo . host !== this . repo_ . repoInfo_ . host ) {
162
161
fatal (
163
162
apiName +
164
163
': Host name does not match the current database: ' +
165
164
'(found ' +
166
165
repoInfo . host +
167
166
' but expected ' +
168
- expectedHost +
167
+ this . repo_ . repoInfo_ . host +
169
168
')'
170
169
) ;
171
170
}
Original file line number Diff line number Diff line change @@ -57,9 +57,6 @@ export class Repo {
57
57
/** Key for uniquely identifying this repo, used in RepoManager */
58
58
readonly key : string ;
59
59
60
- /** Record of the original host, which does not change even if useEmulator mutates the repo */
61
- readonly originalHost : string ;
62
-
63
60
dataUpdateCount = 0 ;
64
61
private infoSyncTree_ : SyncTree ;
65
62
private serverSyncTree_ : SyncTree ;
@@ -93,7 +90,6 @@ export class Repo {
93
90
) {
94
91
// This key is intentionally not updated if RepoInfo is later changed or replaced
95
92
this . key = this . repoInfo_ . toURLString ( ) ;
96
- this . originalHost = this . repoInfo_ . host ;
97
93
}
98
94
99
95
start ( ) : void {
Original file line number Diff line number Diff line change @@ -229,8 +229,8 @@ describe('Database Tests', () => {
229
229
} ) ;
230
230
231
231
it ( 'ref() validates project' , ( ) => {
232
- const db1 = defaultApp . database ( 'http://bar.foo .com' ) ;
233
- const db2 = defaultApp . database ( 'http://foo.bar .com' ) ;
232
+ const db1 = defaultApp . database ( 'http://bar.firebaseio .com' ) ;
233
+ const db2 = defaultApp . database ( 'http://foo.firebaseio .com' ) ;
234
234
235
235
const ref1 = db1 . ref ( 'child' ) ;
236
236
You can’t perform that action at this time.
0 commit comments