servo / rust-url

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

Ignore set_scheme when input contains trailing/leading C0 controls #816

Open CYBAI opened 1 year ago

CYBAI commented 1 year ago

When we use the parser::Input::new, it will initialize the input iterator with trimming both whitespaces and C0 controls. However, for scheme, we should only trim whitespaces. Thus, with moving from ::new to ::trim_tab_and_newlines could fix the issue.

This PR will fix #815.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.02 :warning:

Comparison is base (edeaea7) 82.74% compared to head (9c16caa) 82.72%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #816 +/- ## ========================================== - Coverage 82.74% 82.72% -0.02% ========================================== Files 20 20 Lines 3303 3305 +2 ========================================== + Hits 2733 2734 +1 - Misses 570 571 +1 ``` | [Impacted Files](https://codecov.io/gh/servo/rust-url/pull/816?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=servo) | Coverage Δ | | |---|---|---| | [url/src/lib.rs](https://codecov.io/gh/servo/rust-url/pull/816?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=servo#diff-dXJsL3NyYy9saWIucnM=) | `76.41% <100.00%> (+0.06%)` | :arrow_up: | | [data-url/tests/wpt.rs](https://codecov.io/gh/servo/rust-url/pull/816?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=servo#diff-ZGF0YS11cmwvdGVzdHMvd3B0LnJz) | `84.41% <0.00%> (-1.30%)` | :arrow_down: | 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 at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

bors-servo commented 1 year ago

:umbrella: The latest upstream changes (presumably 115837002b4b56be70e3a67813716931c6c88e47) made this pull request unmergeable. Please resolve the merge conflicts.