Skip to content

Commit

Permalink
Fix search setting for non-special urls with space, query and fragment (
Browse files Browse the repository at this point in the history
  • Loading branch information
edgul authored Nov 9, 2023
1 parent ae8d29e commit 67fc273
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion url/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,9 @@ impl Url {
});
} else {
self.query_start = None;
self.strip_trailing_spaces_from_opaque_path();
if fragment.is_none() {
self.strip_trailing_spaces_from_opaque_path();
}
}

self.restore_already_parsed_fragment(fragment);
Expand Down
4 changes: 1 addition & 3 deletions url/tests/expected_failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@
<foo:///some/path> set pathname to <>
<http://example.net:8080/path> set port to <randomstring>
<file:///var/log/system.log> set href to <http://0300.168.0xF0>
<data:space ?query#fragment> set search to <>
<sc:space ?query#fragment> set search to <>
<file://monkey/> set pathname to <\\\\>
<file:///unicorn> set pathname to <//\\/>
<file:///unicorn> set pathname to <//monkey/..//>
<non-spec:/> set pathname to </.//p>
<non-spec:/> set pathname to </..//p>
<non-spec:/> set pathname to <//p>
<non-spec:/.//> set pathname to <p>
<non-spec:/.//> set pathname to <p>

0 comments on commit 67fc273

Please sign in to comment.