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

InvalidPort is returned for URLs with a '#' #860

Closed
1 task done
adriangb opened this issue Jul 20, 2023 · 1 comment
Closed
1 task done

InvalidPort is returned for URLs with a '#' #860

adriangb opened this issue Jul 20, 2023 · 1 comment

Comments

@adriangb
Copy link

  • Note that this crate implements the URL Standard not RFC 1738 or RFC 3986

The following Postgres DSN fails to parse: postgresql://postgres:postgres#@localhost:5432/postgres. I'm not sure if this is intended or a bug, if it's the former please go ahead and close.

@valenting
Copy link
Collaborator

According to the reference URL parser this is an invalid URL - link - The # marks the start of the fragment, so the parts before it would be the host and port. Since :posgres isn't a valid port number, the parsing fails.

For this to work, the user and password need to be percent encoded using the user-info percent encoding set

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