2
0
mirror of https://github.com/boostorg/url.git synced 2026-01-19 04:42:15 +00:00

fix: resolve replicates ref fragment in all cases

fix #920
This commit is contained in:
Alan de Freitas
2025-08-26 16:10:20 -05:00
parent e9bec4c8d1
commit 9b4c4b440e
2 changed files with 11 additions and 0 deletions

View File

@@ -1580,6 +1580,8 @@ resolve(
if(ref.has_fragment())
set_encoded_fragment(
ref.encoded_fragment());
else
remove_fragment();
return {};
}
if(ref.is_path_absolute())

View File

@@ -1047,6 +1047,15 @@ struct url_test
BOOST_TEST_CSTR_EQ(u, "https:path2");
}
}
// issue #920
{
url u("https://www.example.org/path/index.html?a%20b=5%206&x%20y=34#frag");
url ref("?asdf%20qwer=1%202%20");
BOOST_TEST(u.resolve(ref));
BOOST_TEST_CSTR_EQ(u.buffer(), "https://www.example.org/path/index.html?asdf%20qwer=1%202%20");
BOOST_TEST(!u.has_fragment());
}
}
//--------------------------------------------