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

Robert Munteanu commented on SLING-11032:
-----------------------------------------

Looking at https://sling.apache.org/documentation/the-sling-engine/filters.html 
I am not sure this is implemented. Have you tried setting the property to an 
empty string array?

> @SlingServletFilter(extensions = "") not restricting filter matching to 
> extensionless requests
> ----------------------------------------------------------------------------------------------
>
>                 Key: SLING-11032
>                 URL: https://issues.apache.org/jira/browse/SLING-11032
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Henry Kuijpers
>            Priority: Major
>
> {code:java}
> @SlingServletFilter(
>     extensions = ""
>     pattern = "/bin/my-servlet",
>     methods = HttpConstants.METHOD_POST
> )
> public class MyFilter implements Filter {
> }
> {code}
> I would expect this code to evaluate to a filter that would only match a 
> request that has path "/bin/my-servlet", no extension and method POST. 
> Instead, all requests match (Sling Engine acts as if there was no extension 
> constraint configured).
> I specifically don't want this filter to be called when the request is 
> "/bin/my-servlet.json" or /bin/my-servlet.xml" for example.
> Generated XML:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.3.0"; 
> name="x.MyFilter" configuration-policy="require" immediate="true">
>   <property name="sling.filter.pattern" type="String" 
> value="/bin/my-servlet"/>
>   <property name="sling.filter.methods" type="String">POST</property>
>   <property name="sling.filter.extensions" type="String"></property>
>   <property name="sling.filter.scope" type="String">REQUEST</property>
>   <property name="sling.filter.suffix.pattern" type="String" value=""/>
>   <service>
>     <provide interface="javax.servlet.Filter"/>
>   </service>
>   <implementation class="x.MyFilter"/>
> </scr:component>
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to