Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
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).