Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-825

Trailing slash in URI results in "IllegalArgumentException: There is no configured chain under the name/key"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7.1
    • 2.0.0-alpha, 1.8.0
    • None
    • None

    Description

      We recently attempted to upgrade our Dropwizard-based project to 1.7.1 from 1.7.0. We immediately hit a failure in our end-to-end test suite.

      The case is when the client sends a request URI with trailing slash and it matches one of the patterns we defined in shiro.ini (the pattern does not have a trailing slash).

      The pattern is:

      /api/models/*/etl/templates
      

      The client URI is /api/models/1024831678847123456/etl/templates/

      The error and stack trace in Shiro 1.7.1:

      javax.servlet.ServletException: Filtered request failed.
      	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:384)
      	at 
      ...
      ...
      Caused by: java.lang.IllegalArgumentException: There is no configured chain under the name/key [/api/models/1024831678847123456/etl/templates].
      	at org.apache.shiro.web.filter.mgt.DefaultFilterChainManager.proxy(DefaultFilterChainManager.java:357)
      	at org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver.getChain(PathMatchingFilterChainResolver.java:129)
      	at org.apache.shiro.web.servlet.AbstractShiroFilter.getExecutionChain(AbstractShiroFilter.java:416)
      	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
      	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
      	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
      	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
      	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
      	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
      	... 54 common frames omitted
      

      There is no error if the client does not send the trailing slash in the URI. There is also no error with Shiro 1.7.0.

      Attachments

        Activity

          People

            bdemers Brian Demers
            zalbee Albert Choi
            Votes:
            0 Vote for this issue
            Watchers:
            2 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 - 1h 40m
                1h 40m