From 800b684750700d30ca2884fe49a99a1a15303210 Mon Sep 17 00:00:00 2001 From: Dominic Date: Wed, 3 Jun 2026 16:39:30 +0200 Subject: [PATCH 1/2] Fix hostname preservation in file: URLs that contain drive letters Fixes #1126 --- url/src/parser.rs | 13 ++----------- url/tests/expected_failures.txt | 3 --- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/url/src/parser.rs b/url/src/parser.rs index dbdf9b906..e4ca557c0 100644 --- a/url/src/parser.rs +++ b/url/src/parser.rs @@ -529,9 +529,8 @@ impl Parser<'_> { self.serialization.push_str("file://"); let scheme_end = "file".len() as u32; let host_start = "file://".len() as u32; - let (path_start, mut host, remaining) = - self.parse_file_host(input_after_next_char)?; - let mut host_end = to_u32(self.serialization.len())?; + let (path_start, host, remaining) = self.parse_file_host(input_after_next_char)?; + let host_end = to_u32(self.serialization.len())?; let mut has_host = !matches!(host, HostInternal::None); let remaining = if path_start { self.parse_path_start(SchemeType::File, &mut has_host, remaining) @@ -541,14 +540,6 @@ impl Parser<'_> { self.parse_path(SchemeType::File, &mut has_host, path_start, remaining) }; - // For file URLs that have a host and whose path starts - // with the windows drive letter we just remove the host. - if !has_host { - self.serialization - .drain(host_start as usize..host_end as usize); - host_end = host_start; - host = HostInternal::None; - } let (query_start, fragment_start) = self.parse_query_and_fragment(scheme_type, scheme_end, remaining)?; return Ok(Url { diff --git a/url/tests/expected_failures.txt b/url/tests/expected_failures.txt index 8d4407c45..75b6ab7cb 100644 --- a/url/tests/expected_failures.txt +++ b/url/tests/expected_failures.txt @@ -19,9 +19,6 @@ against against against - - - against against against From 03c3b1faecf46e19fd70df63e490eabef9b490ee Mon Sep 17 00:00:00 2001 From: Dominic Date: Wed, 17 Jun 2026 15:18:27 +0200 Subject: [PATCH 2/2] ci: latest idna_adapter is incompatible with Rust 1.82 --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c5e5a1f0..948c0c6a0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,6 +53,7 @@ jobs: if: | matrix.rust == '1.82.0' run: | + cargo update -p idna_adapter --precise 1.2.1 cargo update -p icu_normalizer --precise 2.0.1 cargo update -p icu_provider --precise 2.0.0 cargo update -p icu_locale_core --precise 2.0.1