From c4c2e14b1b2cbd234772ca6f2be2a85528b6bc13 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 22 Aug 2019 10:34:59 +0200 Subject: Clarify a corner case Change-Id: I98c29cbdb701f00fa73f9c8107fb4349b48a564e Reviewed-on: https://gerrit.libreoffice.org/78015 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- stoc/test/uriproc/test_uriproc.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'stoc/test') diff --git a/stoc/test/uriproc/test_uriproc.cxx b/stoc/test/uriproc/test_uriproc.cxx index 918cd1af1a15..b601eb3a1e04 100644 --- a/stoc/test/uriproc/test_uriproc.cxx +++ b/stoc/test/uriproc/test_uriproc.cxx @@ -979,7 +979,17 @@ void Test::testMakeAbsolute() { css::uri::RelativeUriExcessParentSegments_REMOVE, "scheme://a#s2" }, { "schema://a", "schema://b/c/../d", true, css::uri::RelativeUriExcessParentSegments_REMOVE, - "schema://b/d" } }; + "schema://b/d" }, + + // Per RFC 3986 Section 5.2.1 "Pre-parse the Base URI", "Normalization of the base URI + // [...; esp. dot-segment removal per Section 6.2.2.3 "Path Segment Normalization"] is + // optional" (and not done by our implemenation), so if the relative URI has no scheme and + // no authority and an empty path, the Base URI's path is used unmodified per Section 5.2.2 + // "Transform References" and thus still contains dot-segments: + { "scheme:/a/../b/c", "", true, css::uri::RelativeUriExcessParentSegments_REMOVE, + "scheme:/a/../b/c" }, + { "scheme:/a/../b/c", "d", true, css::uri::RelativeUriExcessParentSegments_REMOVE, + "scheme:/b/d" } }; for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) { css::uno::Reference< css::uri::XUriReference > baseUriRef( m_uriFactory->parse( -- cgit