Skip to content

Commit 92dc48b

Browse files
committed
x
1 parent 5a368ac commit 92dc48b

File tree

1 file changed

+5
-6
lines changed
  • packages/database/src/core/util/libs

1 file changed

+5
-6
lines changed

packages/database/src/core/util/libs/parser.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,12 @@ export const parseDatabaseURL = function(
178178
domain = 'localhost';
179179
} else {
180180
const dotInd = host.indexOf('.');
181-
if (dotInd === -1) {
182-
return; // Not a valid URL.
181+
if (dotInd !== -1) {
182+
// Normalize namespaces to lowercase to share storage / connection.
183+
subdomain = host.substring(0, dotInd).toLowerCase();
184+
namespace = subdomain;
185+
domain = host.substring(dotInd + 1);
183186
}
184-
// Normalize namespaces to lowercase to share storage / connection.
185-
subdomain = host.substring(0, dotInd).toLowerCase();
186-
namespace = subdomain;
187-
domain = host.substring(dotInd + 1);
188187
}
189188
// Always treat the value of the `ns` as the namespace name if it is present.
190189
if ('ns' in queryParams) {

0 commit comments

Comments
 (0)