You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:00:56 UTC
[sling-org-apache-sling-resourceresolver] 12/24: SLING-2741 - Bad
Vanity URL breaks whole Sling Resource Resolver
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.resourceresolver-1.0.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git
commit 535ba3642e82b0e16f2dd4e40adeb3994bd0cead
Author: Antonio Sanso <as...@apache.org>
AuthorDate: Tue Feb 26 15:41:50 2013 +0000
SLING-2741 - Bad Vanity URL breaks whole Sling Resource Resolver
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/resourceresolver@1450227 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/resourceresolver/impl/mapping/MapEntries.java | 8 +++++++-
.../sling/resourceresolver/impl/mapping/MapEntry.java | 14 ++++++++++++--
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
index 59fbd8e..aec2581 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
@@ -442,7 +442,13 @@ public class MapEntries implements EventHandler {
}
// add resolution entries for this node
- final MapEntry childResolveEntry = MapEntry.createResolveEntry(childPath, child, trailingSlash);
+ MapEntry childResolveEntry = null;
+ try{
+ childResolveEntry=MapEntry.createResolveEntry(childPath, child, trailingSlash);
+ }catch (IllegalArgumentException iae){
+ //ignore this entry
+ log.debug("ignored entry due exception ",iae);
+ }
if (childResolveEntry != null) {
entries.add(childResolveEntry);
}
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
index 0259cd9..8be5d7d 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
@@ -207,8 +207,18 @@ public class MapEntry implements Comparable<MapEntry> {
internalRedirect.length);
for (final String redir : internalRedirect) {
if (!redir.contains("$")) {
- prepEntries.add(new MapEntry(redir.concat(endHook),
- status, trailingSlash, url));
+ MapEntry mapEntry = null;
+ try{
+ mapEntry = new MapEntry(redir.concat(endHook), status, trailingSlash, url);
+ }catch (IllegalArgumentException iae){
+ //ignore this entry
+ LoggerFactory
+ .getLogger(MapEntry.class)
+ .debug("ignored entry due exception ",iae);
+ }
+ if (mapEntry!=null){
+ prepEntries.add(mapEntry);
+ }
}
}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.