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() {
3434 return this . connectionPromise ;
3535 }
3636
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-
5037 this . connectionPromise = Promise . resolve ( ) . then ( ( ) => {
51- return MongoClient . connect ( encodedMongoURI , { uri_decode_auth : true } ) ;
38+ return MongoClient . connect ( this . mongoURI ) ;
5239 } ) . then ( ( db ) => {
5340 this . db = db ;
5441 } ) ;
You can’t perform that action at this time.
0 commit comments