File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -868,6 +868,12 @@ TEST_P(ParsedURLPathSegmentsTest, segmentsAreCorrect)
868868 EXPECT_EQ (encodeUrlPath (segments), testCase.path );
869869}
870870
871+ TEST_P (ParsedURLPathSegmentsTest, to_string)
872+ {
873+ const auto & testCase = GetParam ();
874+ EXPECT_EQ (testCase.url , parseURL (testCase.url ).to_string ());
875+ }
876+
871877INSTANTIATE_TEST_SUITE_P (
872878 ParsedURL,
873879 ParsedURLPathSegmentsTest,
@@ -886,6 +892,13 @@ INSTANTIATE_TEST_SUITE_P(
886892 .skipEmpty = false ,
887893 .description = " empty_authority_empty_path" ,
888894 },
895+ ParsedURLPathSegmentsTestCase{
896+ .url = " path:/" ,
897+ .segments = {" " , " " },
898+ .path = " /" ,
899+ .skipEmpty = false ,
900+ .description = " empty_authority_root_path" ,
901+ },
889902 ParsedURLPathSegmentsTestCase{
890903 .url = " scheme:///" ,
891904 .segments = {" " , " " },
Original file line number Diff line number Diff line change @@ -350,7 +350,7 @@ std::string ParsedURL::renderAuthorityAndPath() const
350350 must either be empty or begin with a slash ("/") character. */
351351 assert (path.empty () || path.front ().empty ());
352352 res += authority->to_string ();
353- } else if (std::ranges::equal (std::views::take (path, 2 ), std::views::repeat (" " , 2 ))) {
353+ } else if (std::ranges::equal (std::views::take (path, 3 ), std::views::repeat (" " , 3 ))) {
354354 /* If a URI does not contain an authority component, then the path cannot begin
355355 with two slash characters ("//") */
356356 unreachable ();
You can’t perform that action at this time.
0 commit comments