Skip to content
Browse files

Optionally URI decoding auth parts in Db.connect

  • Loading branch information...
1 parent 3d4a880 commit 42e71b2fb1c5ab7c8882c5d1484323da5959024c @mrkurt mrkurt committed Apr 12, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/mongodb/db.js
View
6 lib/mongodb/db.js
@@ -1715,6 +1715,12 @@ Db.connect = function(url, options, callback) {
var authPart = match[1] || '';
var auth = authPart.split(':', 2);
+ if(options['uri_decode_auth']){
+ auth[0] = decodeURIComponent(auth[0]);
+ if(auth[1]){
+ auth[1] = decodeURIComponent(auth[1]);
+ }
+ }
var hostPart = match[2];
var dbname = match[3] || 'default';
var urlOptions = (match[4] || '').split(/[&;]/);

0 comments on commit 42e71b2

Please sign in to comment.
Something went wrong with that request. Please try again.