File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
packages/database/src/core/util/libs Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -174,16 +174,14 @@ export const parseDatabaseURL = function(
174
174
colonInd = dataURL . length ;
175
175
}
176
176
177
- let dotInd = host . indexOf ( '.' ) ;
178
- if ( dotInd === - 1 ) {
179
- dotInd = colonInd ;
180
- }
181
- const hostFirstPart = host . substring ( 0 , dotInd ) ;
182
- if ( hostFirstPart . toLowerCase ( ) === 'localhost' ) {
177
+ if ( host . slice ( 0 , colonInd ) . toLowerCase ( ) === 'localhost' ) {
183
178
domain = 'localhost' ;
184
- } else if ( dotInd === colonInd ) {
185
- return ; // Not a valid URL.
186
179
} else {
180
+ let dotInd = host . indexOf ( '.' ) ;
181
+ if ( dotInd === - 1 ) {
182
+ return ; // Not a valid URL.
183
+ }
184
+ const hostFirstPart = host . substring ( 0 , dotInd ) ;
187
185
domain = host . substring ( dotInd + 1 ) ;
188
186
// Normalize namespaces to lowercase to share storage / connection.
189
187
subdomain = hostFirstPart . toLowerCase ( ) ;
You can’t perform that action at this time.
0 commit comments