[ 
https://issues.apache.org/jira/browse/SLING-9230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17064048#comment-17064048
 ] 

Konrad Windszus commented on SLING-9230:
----------------------------------------

Sling is not bound to the JCR Resource Provider and does not define any 
limitation on {{sling:resourcType}} value 
(https://sling.apache.org/documentation/the-sling-engine/resources.html#resource-types).
 Introducing such limitations now only because Oak cannot correctly deal with 
such values can lead to unexpected regressions. IMHO the fix in Oak should be 
enough.

> Servlet should not be allowed to register with invalid ResourceTypes
> --------------------------------------------------------------------
>
>                 Key: SLING-9230
>                 URL: https://issues.apache.org/jira/browse/SLING-9230
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>    Affects Versions: Servlets Resolver 2.6.4
>            Reporter: rafiya sirin
>            Priority: Minor
>         Attachments: Screen Shot 2020-03-10 at 10.12.54 PM.png, stacktrace.txt
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Servlets are allowed to register even when the resource types are specified 
> as 
> SLING_SERVLET_RESOURCE_TYPES + "=" + "[/test,/path]"
> This is invalid because getOakPath for paths starting with "[" and ending 
> with "]" return null. This creates an unwanted scenario where 
> ResourceChangeListeners fail to register with a NPE. The NPE on JCR is fixed 
> with commit : 
> [https://github.com/apache/jackrabbit-oak/commit/2e37d7a507186484e13897549681bf29b17461fc]
>  
> However we should still fix this in sling, to not accept resource types which 
> start with "[" and end with "]"
> JCR code which returns null : 
> [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/impl/NamePathMapperImpl.java#L91]
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to