File tree Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -34,21 +34,8 @@ ExportAdapter.prototype.connect = function() {
34
34
return this . connectionPromise ;
35
35
}
36
36
37
- //http://regexr.com/3cncm
38
- if ( ! this . mongoURI . match ( / ^ m o n g o d b : \/ \/ ( ( .+ ) : ( .+ ) @ ) ? ( [ ^ : @ ] + ) : { 0 , 1 } ( [ ^ : ] + ) \/ ( .+ ?) $ / gm) ) {
39
- throw new Error ( "Invalid mongoURI: " + this . mongoURI )
40
- }
41
- var usernameStart = this . mongoURI . indexOf ( '://' ) + 3 ;
42
- var lastAtIndex = this . mongoURI . lastIndexOf ( '@' ) ;
43
- var encodedMongoURI = this . mongoURI ;
44
- var split = null ;
45
- if ( lastAtIndex > 0 ) {
46
- split = this . mongoURI . slice ( usernameStart , lastAtIndex ) . split ( ':' ) ;
47
- encodedMongoURI = this . mongoURI . slice ( 0 , usernameStart ) + encodeURIComponent ( split [ 0 ] ) + ':' + encodeURIComponent ( split [ 1 ] ) + this . mongoURI . slice ( lastAtIndex ) ;
48
- }
49
-
50
37
this . connectionPromise = Promise . resolve ( ) . then ( ( ) => {
51
- return MongoClient . connect ( encodedMongoURI , { uri_decode_auth : true } ) ;
38
+ return MongoClient . connect ( this . mongoURI ) ;
52
39
} ) . then ( ( db ) => {
53
40
this . db = db ;
54
41
} ) ;
You can’t perform that action at this time.
0 commit comments