Clear remaining M0/M1 bugs on master (T-22, T-25, T-27, T-31, T-35)
This commit is contained in:
parent
9e259ca43b
commit
b20fc28e45
8 changed files with 245 additions and 252 deletions
|
|
@ -114,6 +114,7 @@ function isValidMongoUri(uri: string): boolean {
|
|||
// Match mongodb-connection-string-url: authority ends at '/' or '?', never '#'
|
||||
const delimiterMatch = /[/?]/.exec(rest);
|
||||
const authority = delimiterMatch ? rest.slice(0, delimiterMatch.index) : rest;
|
||||
const remainder = delimiterMatch ? rest.slice(delimiterMatch.index) : '';
|
||||
if (!authority || authority.includes('#')) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -125,6 +126,11 @@ function isValidMongoUri(uri: string): boolean {
|
|||
if (firstAtIndex !== -1 && authority.indexOf('@', firstAtIndex + 1) !== -1) {
|
||||
return false;
|
||||
}
|
||||
// Match mongodb-connection-string-url: without userinfo in authority, an unencoded '@'
|
||||
// later in the path or query is rejected by the MongoDB driver.
|
||||
if (firstAtIndex === -1 && remainder.includes('@')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const hostList = firstAtIndex >= 0 ? authority.slice(firstAtIndex + 1) : authority;
|
||||
if (!hostList) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue