diff options
author | Sara Golemon <sara.golemon@mongodb.com> | 2017-09-14 15:24:18 -0400 |
---|---|---|
committer | Sara Golemon <sara.golemon@mongodb.com> | 2017-09-21 11:19:26 -0400 |
commit | f3bf7e7920a51df7100238a55c304ed7cd3aed1f (patch) | |
tree | a43a89c9a0f960cea7a2f9ce31c5ecc3243d5131 /src/mongo/shell/mongo.js | |
parent | 6c4c5f47b2e3fbf841683448a5e117e86f72c4ef (diff) | |
download | mongo-f3bf7e7920a51df7100238a55c304ed7cd3aed1f.tar.gz |
SERVER-29921 rewrite URI parser
Diffstat (limited to 'src/mongo/shell/mongo.js')
-rw-r--r-- | src/mongo/shell/mongo.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/shell/mongo.js b/src/mongo/shell/mongo.js index 231206a9766..76d0d53dfb0 100644 --- a/src/mongo/shell/mongo.js +++ b/src/mongo/shell/mongo.js @@ -234,6 +234,9 @@ connect = function(url, user, pass) { if (!url.startsWith("mongodb://")) { const colon = url.lastIndexOf(":"); const slash = url.lastIndexOf("/"); + if (url.split("/").length > 1) { + url = url.substring(0, slash).replace(/\//g, "%2F") + url.substring(slash); + } if (slash == 0) { throw Error("Failed to parse mongodb:// URL: " + url); } |