Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion url/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl<'i> Input<'i> {
}

#[inline]
fn starts_with<P: Pattern>(&self, p: P) -> bool {
pub fn starts_with<P: Pattern>(&self, p: P) -> bool {
p.split_prefix(&mut self.clone())
}

Expand Down
5 changes: 4 additions & 1 deletion url/src/quirks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ pub fn set_hostname(url: &mut Url, new_hostname: &str) -> Result<(), ()> {
return Ok(());
}

if let Ok((host, _remaining)) = Parser::parse_host(input, scheme_type) {
if let Ok((host, remaining)) = Parser::parse_host(input, scheme_type) {
if remaining.starts_with(':') {
return Err(());
};
if let Host::Domain(h) = &host {
if h.is_empty() {
// Empty host on special not file url
Expand Down
2 changes: 0 additions & 2 deletions url/tests/expected_failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
<file:///.//> against <file:////>
<file:.//p>
<file:/.//p>
<http://example.net/path> set hostname to <example.com:8080>
<http://example.net:8080/path> set hostname to <example.com:>
<non-spec:/.//p> set hostname to <h>
<non-spec:/.//p> set hostname to <>
<foo:///some/path> set pathname to <>
Expand Down
Loading