From 67fc2730b6585ea60f7da6987459c554775967af Mon Sep 17 00:00:00 2001 From: edgul Date: Thu, 9 Nov 2023 10:28:18 -0500 Subject: [PATCH] Fix search setting for non-special urls with space, query and fragment (#879) --- url/src/lib.rs | 4 +++- url/tests/expected_failures.txt | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/url/src/lib.rs b/url/src/lib.rs index 6879d9f63..febdb3609 100644 --- a/url/src/lib.rs +++ b/url/src/lib.rs @@ -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); diff --git a/url/tests/expected_failures.txt b/url/tests/expected_failures.txt index 1c404a8b7..168a8327f 100644 --- a/url/tests/expected_failures.txt +++ b/url/tests/expected_failures.txt @@ -42,12 +42,10 @@ set pathname to <> set port to set href to - set search to <> - set search to <> set pathname to <\\\\> set pathname to set pathname to set pathname to set pathname to set pathname to - set pathname to

\ No newline at end of file + set pathname to