[
https://issues.apache.org/jira/browse/SLING-12169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Konrad Windszus updated SLING-12169:
------------------------------------
Description:
Sling API does not limit valid characters for resource names. However, the
underlying providers may impose some limitation (like JCR does).
Still the ResourceResolverImpl.getAllMappings() does incorrectly strip the
given resource path by stripping of everything after {{?}} or {{#}}
(https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/a19995d2ec700f1b444adc52c783cdbceae5a7ce/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java#L117).
That is an invalid assumption as resource names containing those characters
are totally fine for Sling.
The javadoc should be clarified with regards to the given argument. Either it
is a resource path only (then it should not be preprocessed) or it contains an
encoded URI (then it needs to be decoded first by the ResourceMapperImpl).
was:
Sling API does not limit valid characters for resource names. However, the
underlying providers may impose some limitation (like JCR does).
Still the ResourceResolverImpl.getAllMappings() does incorrectly strip the
given resource path by stripping of everything after {{?}} or {{#}}
(https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/a19995d2ec700f1b444adc52c783cdbceae5a7ce/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java#L117).
That is an invalid assumption as resource names containing those characters
are totally fine for Sling.
The javadoc should be clarified with regards to the given argument. Either it
is a resource path only (then it should be preprocessed) or it contains a
encoded URI (then it needs to be decoded first by the ResourceMapperImpl).
> Incorrect mapping of resource names containing '#' or '?'
> ---------------------------------------------------------
>
> Key: SLING-12169
> URL: https://issues.apache.org/jira/browse/SLING-12169
> Project: Sling
> Issue Type: Bug
> Components: ResourceResolver
> Reporter: Konrad Windszus
> Priority: Major
>
> Sling API does not limit valid characters for resource names. However, the
> underlying providers may impose some limitation (like JCR does).
> Still the ResourceResolverImpl.getAllMappings() does incorrectly strip the
> given resource path by stripping of everything after {{?}} or {{#}}
> (https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/a19995d2ec700f1b444adc52c783cdbceae5a7ce/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java#L117).
> That is an invalid assumption as resource names containing those characters
> are totally fine for Sling.
> The javadoc should be clarified with regards to the given argument. Either it
> is a resource path only (then it should not be preprocessed) or it contains
> an encoded URI (then it needs to be decoded first by the ResourceMapperImpl).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)