servo / rust-url

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

No colon when setting empty password #825

Closed qsantos closed 1 year ago

qsantos commented 1 year ago

This addresses https://github.com/servo/rust-url/issues/796 by removing the colon (:) when setting the password to Some(""). According to the URL Standard:

If url’s password is not the empty string, then append U+003A (:), followed by url’s password, to output.

This cherry-picks https://github.com/servo/rust-url/pull/806 to add some tests for this.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 :tada:

Comparison is base (1092960) 82.73% compared to head (f2842a5) 82.76%.

:exclamation: Current head f2842a5 differs from pull request most recent head 414308c. Consider uploading reports for the commit 414308c to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #825 +/- ## ========================================== + Coverage 82.73% 82.76% +0.02% ========================================== Files 20 20 Lines 3337 3337 ========================================== + Hits 2761 2762 +1 + Misses 576 575 -1 ``` | [Impacted Files](https://codecov.io/gh/servo/rust-url/pull/825?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=servo) | Coverage Δ | | |---|---|---| | [url/src/host.rs](https://codecov.io/gh/servo/rust-url/pull/825?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=servo#diff-dXJsL3NyYy9ob3N0LnJz) | `96.95% <100.00%> (-0.02%)` | :arrow_down: | | [url/src/lib.rs](https://codecov.io/gh/servo/rust-url/pull/825?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=servo#diff-dXJsL3NyYy9saWIucnM=) | `76.51% <100.00%> (+0.03%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://codecov.io/gh/servo/rust-url/pull/825/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=servo) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=servo). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=servo)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.