Skip to content
This repository has been archived by the owner on Oct 8, 2018. It is now read-only.

Fixes: #7 - don't escape username and password #8

Merged
merged 2 commits into from
Sep 2, 2018

Conversation

davidjwilkins
Copy link
Contributor

No description provided.

@aeneasr
Copy link
Member

aeneasr commented Sep 1, 2018

Thanks! Could you also please add a test?

connector.go Outdated

userinfo := c.URL.User.Username()
if password, hasPassword := c.URL.User.Password(); hasPassword {
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.

Does this work when userinfo or password have a :?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This works when password has a :, but fails when username does. It looks like this is related to go-sql-driver/mysql#591 - their DSN parser doesn't support it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to be clear, the existing implementation also fails when the username has a :, and this does not fix that. this does fix when the username or password has certain other characters

Copy link
Member

Choose a reason for hiding this comment

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

Ah, didn't know that, thanks!

Signed-off-by: David Wilkins <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants