You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by pa...@apache.org on 2021/06/25 11:22:08 UTC

[sling-org-apache-sling-engine] branch issues/SLING-10554 created (now 85e9533)

This is an automated email from the ASF dual-hosted git repository.

pauls pushed a change to branch issues/SLING-10554
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-engine.git.


      at 85e9533  SLING-10554: The check for valid requests should not fail on a resolution path that is null

This branch includes the following new commits:

     new 85e9533  SLING-10554: The check for valid requests should not fail on a resolution path that is null

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[sling-org-apache-sling-engine] 01/01: SLING-10554: The check for valid requests should not fail on a resolution path that is null

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch issues/SLING-10554
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-engine.git

commit 85e95339061992e0e8fce34c12125c00161265d3
Author: Karl Pauls <ka...@gmail.com>
AuthorDate: Fri Jun 25 13:21:54 2021 +0200

    SLING-10554: The check for valid requests should not fail on a resolution path that is null
---
 src/main/java/org/apache/sling/engine/impl/request/RequestData.java  | 2 +-
 .../java/org/apache/sling/engine/impl/request/RequestDataTest.java   | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/engine/impl/request/RequestData.java b/src/main/java/org/apache/sling/engine/impl/request/RequestData.java
index 24e6ff6..70874ed 100644
--- a/src/main/java/org/apache/sling/engine/impl/request/RequestData.java
+++ b/src/main/java/org/apache/sling/engine/impl/request/RequestData.java
@@ -595,7 +595,7 @@ public class RequestData {
                 return false;
             }
         }
-        return !PREVENT_TRAVERSAL.matcher(resourcePath).matches();
+        return resourcePath == null || !PREVENT_TRAVERSAL.matcher(resourcePath).matches();
     }
 
     // ---------- Content inclusion stacking -----------------------------------
diff --git a/src/test/java/org/apache/sling/engine/impl/request/RequestDataTest.java b/src/test/java/org/apache/sling/engine/impl/request/RequestDataTest.java
index 2a27812..c3a6ce5 100644
--- a/src/test/java/org/apache/sling/engine/impl/request/RequestDataTest.java
+++ b/src/test/java/org/apache/sling/engine/impl/request/RequestDataTest.java
@@ -166,6 +166,11 @@ public class RequestDataTest {
     }
 
     @Test
+    public void testNullResolutionPath() {
+        assertValidRequest(true, null);
+    }
+
+    @Test
     public void testDotsAnd5B() {
         assertValidRequest(false, "/a/..[[./b");
         assertValidRequest(false, "/a/[............../b");