[ 
https://issues.apache.org/jira/browse/SLING-9230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

rafiya sirin updated SLING-9230:
--------------------------------
    Description: 
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]

 

  was:
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 paths 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]

 


> 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: 10m
>  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