Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9230

Servlet should not be allowed to register with invalid ResourceTypes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • Servlets Resolver 2.6.4
    • None
    • Servlets
    • None

    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

       

      Attachments

        1. Screen Shot 2020-03-10 at 10.12.54 PM.png
          1.19 MB
          rafiya sirin
        2. stacktrace.txt
          7 kB
          rafiya sirin

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sirin rafiya sirin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10h 20m
                  10h 20m