Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 2 additions & 11 deletions url/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions url/tests/expected_failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
<C|\n/> against <file://host/dir/file>
<C|\\> against <file://host/dir/file>
</c:/foo/bar> against <file://host/path>
<file://example.net/C:/>
<file://1.2.3.4/C:/>
<file://[1::8]/C:/>
<C|/> against <file://host/>
</C:/> against <file://host/>
<file:C:/> against <file://host/>
Expand Down
Loading