summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-08-22 10:34:59 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-08-23 21:11:38 +0200
commitc4c2e14b1b2cbd234772ca6f2be2a85528b6bc13 (patch)
tree58106a404a5ac9d0256da7daeb9ed9b3f1705091 /stoc
parentcaabc3f9fc0b7640966bd55ca0a2bc42f255a945 (diff)
Clarify a corner case
Change-Id: I98c29cbdb701f00fa73f9c8107fb4349b48a564e Reviewed-on: https://gerrit.libreoffice.org/78015 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'stoc')
-rw-r--r--stoc/test/uriproc/test_uriproc.cxx12
1 files changed, 11 insertions, 1 deletions
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(