-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing of password with % gives malformed URI error #15
Comments
Why not encode the password so that |
More importantly the MongoDB driver will reject passwords that aren't properly URI encoded. As such there are a number of other characters that could be a problem as well. From the MongoDB native driver source code:
As such, however you are getting the connection string it seems to me that it is imperative that the URI have values encoded properly for the underlying driver which includes encoding the username and passwords accordingly. |
Yeah this is expected behavior unfortunately. MongoDB says that username and password must be URI encoded, so if you have a '%' in your password you need to do mongoose.connect(uri, { user, pass }); If you pass username and password in the |
This is all good to know, thanks for the insight! |
Line 196 in
lib/index.js
:If
parts[1]
is a password that contains a percent sign%
,URIError: URI malformed
is returned.The text was updated successfully, but these errors were encountered: