Permalink
Browse files

Fix isPrefixMatch() to not match extension based URls.

  • Loading branch information...
1 parent 55a0b56 commit 84f674859b1a8456c5ca1c8898f3bd34aa05ee09 @BalusC BalusC committed Dec 1, 2015
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/java/org/omnifaces/config/WebXml.java
@@ -305,11 +305,11 @@ private static boolean isExactMatch(String urlPattern, String url) {
}
private static boolean isPrefixMatch(String urlPattern, String url) {
- return urlPattern.endsWith("/*") ? url.startsWith(urlPattern.substring(0, urlPattern.length() - 2)) : false;
+ return urlPattern.endsWith("/*") && (url + "/").startsWith(urlPattern.substring(0, urlPattern.length() - 1));
}
private static boolean isSuffixMatch(String urlPattern, String url) {
- return urlPattern.startsWith("*.") ? url.endsWith(urlPattern.substring(1)) : false;
+ return urlPattern.startsWith("*.") && url.endsWith(urlPattern.substring(1));
}
private static boolean isRoleMatch(Set<String> roles, String role) {

0 comments on commit 84f6748

Please sign in to comment.