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

Fix the DB username can't contain "@" character #57

Merged
merged 2 commits into from
Jun 7, 2019
Merged

Conversation

yxzhm
Copy link
Contributor

@yxzhm yxzhm commented Jun 5, 2019

If user name of DB contains"@" char, the sqlcon can't connect to the DB.
The DSN example is as following:
DSN=mysql://sa@test.mysql.database.azure.com:MyPassword@(127.0.0.1:3306)/hydra

This PR do a very simple fix.

@CLAassistant
Copy link

CLAassistant commented Jun 5, 2019

CLA assistant check
All committers have signed the CLA.

@@ -196,7 +196,7 @@ func connectionString(clean *url.URL) string {
userinfo := username
password, hasPassword := clean.User.Password()
if hasPassword {
userinfo = url.QueryEscape(userinfo) + ":" + url.QueryEscape(password)
userinfo = userinfo + ":" + password
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only happen when the scheme is mysql

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done the reword, based on your comments

@aeneasr
Copy link
Member

aeneasr commented Jun 7, 2019

Thank you!

@aeneasr aeneasr merged commit f10ffc3 into ory:master Jun 7, 2019
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

Successfully merging this pull request may close these issues.

3 participants