[EMAIL PROTECTED] wrote:
remm 2004/01/11 01:23:42

  Modified:    catalina/src/share/org/apache/catalina/realm RealmBase.java
  Log:
  - Ooops. Put back the if(found) blocks.

I left in some of my changes:


@@ -457,10 +457,7 @@

// Check each defined security constraint
HttpServletRequest hreq = (HttpServletRequest) request.getRequest();
- String uri = request.getDecodedRequestURI();
- String contextPath = hreq.getContextPath();
- if (contextPath.length() > 0)
- uri = uri.substring(contextPath.length());
+ String uri = request.getRequestPathMB().toString();


In many cases, the mapper has the String already, so this often saves one String (and I really don't like substring anyway).

  @@ -546,6 +547,7 @@
                       "' against " + method + " " + uri + " --> " +
                       constraints[i].included(uri, method));
               boolean matched = false;
  +            int pos = -1;
               for(int j=0; j < collection.length; j++){
                   String [] patterns = collection[j].findPatterns();
                   for(int k=0; k < patterns.length && !matched; k++) {
  @@ -558,6 +560,7 @@
                              uri.length()-dot == pattern.length()-1) {

if(pattern.regionMatches(1,uri,dot,uri.length()-dot)) {
                                   matched = true;
  +                                pos = j;
                               }
                           }
                       }
  @@ -565,17 +568,19 @@
               }
               if(matched) {
                   found = true;
  -                if(collection[i].findMethod(method)) {
  +                if(collection[pos].findMethod(method)) {
                       if(results == null) {
                           results = new ArrayList();
  -                    }
  +                    }
                       results.add(constraints[i]);
                   }
               }
           }

i was an index in the constraints array, so this should be a genuine bug.

Rémy



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to