URL with username/password removed creates invalid URL with .to_string()
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 406
- PR merge metrics
- No merged PRs in 30d
Description
When setting username/password to empty string value, : and @ chars should be removed from the URL when using to_string().
Steps to reproduce:
- Have a
StringURL with username and password:https://username:password@example.com. - Create a new URL using
Url::parse()from the String. - Use
set_username()andset_password()to reset the values as empty strings. .as_str()or.to_string()for theUrlshows:https://:@example.com/.
Using version 2.3.1 of the crate.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Url::parse(), set_username(), and set_password() entry points and follow the as_str()/to_string() serialization path. Reproduce the example from the issue, then verify that clearing both credentials removes the ':' and '@' characters from the serialized URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100