Skip to content

dsn: escape and unescape user field #689

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

Closed
wants to merge 1 commit into from
Closed

dsn: escape and unescape user field #689

wants to merge 1 commit into from

Conversation

nemith
Copy link
Contributor

@nemith nemith commented Oct 20, 2017

Description

Sometimes usernames may have characters that need encoding such as : or
@. This fixes the problem by url escaping the username on FormatDSN and
unescaping it on ParseDSN.

Although the DSNs are not proper URIs escaping of username is defined in
https://www.ietf.org/rfc/rfc3986.txt

Fixes: #688

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

Sometimes usernames may have characters that need encoding such as : or
@.  This fixes the problem by url escaping the username on FormatDSN and
unescaping it on ParseDSN.

Although the DSNs are not proper URIs escaping of username is defined in
https://www.ietf.org/rfc/rfc3986.txt

Fixes: #688
@julienschmidt
Copy link
Member

See #591.
This PR might make existing DSNs stop working.

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.

Username with a ':' fails.
2 participants