-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
reverted uri encoding #297
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sounds good to me, having replicasets working is probably more important than passwords with an '@' in them as its easier to change your password than your replicaset architecture :) |
bgw
added a commit
that referenced
this pull request
Mar 12, 2016
The mongodb driver requires auth values be URI encoded: mongodb/node-mongodb-native@0440630 This uses node's built-in url module to encode the auth portion, by parsing and re-formatting it, which causes special characters to get URI encoded properly: https://nodejs.org/api/url.html#url_escaped_characters This is all a bit silly since mongodb just takes our passed uri, and runs it through the same url parser again, but not before explicitly erroring on '@' characters in the uri. This is similiar to #148 (reverted by #297), but with much less code, and hopefully less breakage. Also, note that `uri_decode_auth` is no longer needed. That was removed in the above referenced node-mongodb-native commit. I've tested this on usernames and passwords with @, !, +, and a space. Presumably this would also work with usernames and passwords that are already URI encoded (since parseUrl will simply unescape it, and formatUrl will escape it again).
bgw
added a commit
that referenced
this pull request
Mar 16, 2016
The mongodb driver requires auth values be URI encoded: mongodb/node-mongodb-native@0440630 This uses node's built-in url module to encode the auth portion, by parsing and re-formatting it, which causes special characters to get URI encoded properly: https://nodejs.org/api/url.html#url_escaped_characters This is all a bit silly since mongodb just takes our passed uri, and runs it through the same url parser again, but not before explicitly erroring on '@' characters in the uri. This is similiar to #148 (reverted by #297), but with much less code, and hopefully less breakage. Also, note that `uri_decode_auth` is no longer needed. That was removed in the above referenced node-mongodb-native commit. I've tested this on usernames and passwords with @, !, +, and a space. Presumably this would also work with usernames and passwords that are already URI encoded (since parseUrl will simply unescape it, and formatUrl will escape it again).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverted #148