servo / rust-url

URL parser for Rust
https://docs.rs/url/
Apache License 2.0
1.27k stars 318 forks source link

DB_URL Password complexity is not supported. For example, the password is QAZwsx123@# #805

Closed songlinshu closed 1 year ago

songlinshu commented 1 year ago

Password complexity is not supported. For example, the password is QAZwsx123@# image image

Describe the bug A clear and concise description of what the bug is. Include code snippets if possible.

valenting commented 1 year ago

That's because the password is invalid. https://jsdom.github.io/whatwg-url/#url=bXlzcWw6Ly9zYTpRQVp3c3gxMjMhQCNAMTI3LjAuMC4xOjE0MzMv&base=YWJvdXQ6Ymxhbms=

That's because URL parsers assume the userInfo stops at the first @ and then fails parsing the host because it contains #@. Special characters in the username or password need to be percent encoded.

You can see this working in the small demo

songlinshu commented 1 year ago

Thank you!