You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by gh...@apache.org on 2020/09/11 10:02:58 UTC
[sling-org-apache-sling-resourceresolver] branch
feature/SLING-9662-Introduce-Resource-Mapping-SPI-v2 updated: SLING-9662
Allow null path for resolve()
This is an automated email from the ASF dual-hosted git repository.
ghenzler pushed a commit to branch feature/SLING-9662-Introduce-Resource-Mapping-SPI-v2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git
The following commit(s) were added to refs/heads/feature/SLING-9662-Introduce-Resource-Mapping-SPI-v2 by this push:
new 8e391ad SLING-9662 Allow null path for resolve()
8e391ad is described below
commit 8e391ad1783c120862b814848cd2f82801aa3ba2
Author: georg.henzler <ge...@netcentric.biz>
AuthorDate: Fri Sep 11 12:02:39 2020 +0200
SLING-9662 Allow null path for resolve()
---
.../impl/mappingchain/PathToUriMappingServiceImpl.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mappingchain/PathToUriMappingServiceImpl.java b/src/main/java/org/apache/sling/resourceresolver/impl/mappingchain/PathToUriMappingServiceImpl.java
index 4fe3e12..6c0f327 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mappingchain/PathToUriMappingServiceImpl.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mappingchain/PathToUriMappingServiceImpl.java
@@ -108,7 +108,11 @@ public class PathToUriMappingServiceImpl implements PathToUriMappingService {
}
@NotNull
- public MappingChainResult resolve(@Nullable HttpServletRequest request, @NotNull String path) {
+ public MappingChainResult resolve(@Nullable HttpServletRequest request, @Nullable String path) {
+
+ if (path == null || path.isEmpty()) {
+ path = "/";
+ }
try (ResourceResolver rr = getResourceResolver()) {
MappingChainContextInternal mappingContext = new MappingChainContextInternal(rr);