Skip to content
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

Server initializer does not decode percent characters from mongodb:// url #59

Closed
sebastienwindal opened this issue Oct 30, 2016 · 1 comment

Comments

@sebastienwindal
Copy link

I tried to pass a mongodb:// url with a password that contains an @ symbol like this one:

mongodb://joeshmo:password%40@127.0.0.1:27017

the server init is not decoding percent characted when extracting user and password from url

public convenience init(_ url: NSURL, using tcpDriver: MongoTCP.Type = Socks.TCPClient.self, automatically connecting: Bool = true) throws

Using removingPercentEncoding fixed my issue:

 if let user = url.user?.removingPercentEncoding, let pass = url.password?.removingPercentEncoding
@Joannis
Copy link
Member

Joannis commented Oct 31, 2016

The latest MongoKitten 2 version has this implemented now. Feel free to close the issue if it's working for you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants