Srinidhi created SHIRO-821:
------------------------------

             Summary: Difference in behaviour when matching regex patterns with 
trailing spaces between shiro-core v1.7.0 and v1.7.1
                 Key: SHIRO-821
                 URL: https://issues.apache.org/jira/browse/SHIRO-821
             Project: Shiro
          Issue Type: Bug
    Affects Versions: 1.7.1
            Reporter: Srinidhi


Hi,

        Not sure if this is a bug but there appears to be a difference in the 
way regex patterns with trailing spaces are matched in shiro-core. This 
behavior seems to have changed between v1.7.0 and v1.7.1.

Steps to replicate:

RegexTest.java:

import org.apache.shiro.util.AntPathMatcher;

public class RegexTest {
 public static void main(String[] args) {
 AntPathMatcher matcher = new AntPathMatcher();
 System.out.println("Matching ====" + "/a/b/* " + "==== with ====" + "/a/b/c" + 
"====");
 System.out.println("RESULT: " + matcher.match("/a/b/* ", "/a/b/c"));
 }
}

 

 

Output with v1.7.0:

$ java -cp "shiro-core-1.7.0.jar;." RegexTest
Matching ====/a/b/* ==== with ====/a/b/c====
RESULT: *true*

 

Output with v1.7.1:

$ java -cp "shiro-core-1.7.1.jar;." RegexTest
Matching ====/a/b/* ==== with ====/a/b/c====
RESULT: *false*

 

Can you please let me know if this change was an intentional fix to an existing 
bug or a new bug that got introduced?

Is there any flag to retain the prior behavior?

 

-Thanks

 



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

Reply via email to