File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ function connectionStringHasValidScheme(connectionString: string) {
1818// Adapted from the Node.js driver code:
1919// https://github.com/mongodb/node-mongodb-native/blob/350d14fde5b24480403313cfe5044f6e4b25f6c9/src/connection_string.ts#L146-L206
2020const HOSTS_REGEX = new RegExp (
21- String . raw `^(?<protocol>mongodb(?:\+srv|)):\/\/(?:(?<username>[^:]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^\/?@]+ )(?<rest>.*)`
21+ String . raw `^(?<protocol>mongodb(?:\+srv|)):\/\/(?:(?<username>[^:]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^\/?@]* )(?<rest>.*)`
2222) ;
2323
2424class CaseInsensitiveMap < K extends string = string > extends Map < K , string > {
Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ describe('ConnectionString', () => {
114114 'mongodb+srv://a,b,c/' ,
115115 'mongodb+srv://a:12345/' ,
116116 'mongodbabc://localhost' ,
117- 'totallynotamongodb://localhost'
117+ 'totallynotamongodb://localhost' ,
118+ 'mongodb+srv://Y:X@'
118119 ] ) {
119120 it ( `parsing ${ uri } throws an MongoParseError` , ( ) => {
120121 try {
You can’t perform that action at this time.
0 commit comments