Skip to content

URL with username/password removed creates invalid URL with .to_string() #796

@varjolintu

Description

@varjolintu

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 String URL with username and password: https://username:[email protected].
  • Create a new URL using Url::parse() from the String.
  • Use set_username() and set_password() to reset the values as empty strings.
  • .as_str() or .to_string() for the Url shows: https://:@example.com/.

Using version 2.3.1 of the crate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions