tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm RealmBase.java
Date Sun, 11 Jan 2004 20:16:32 GMT

----- Original Message ----- 
From: "Remy Maucherat" <remm@apache.org>
To: "Tomcat Developers List" <tomcat-dev@jakarta.apache.org>
Sent: Sunday, January 11, 2004 1:27 AM
Subject: Re: cvs commit:
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm
RealmBase.java


> remm@apache.org 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).
>

This was older code that pre-dates the j-t-c Mapper.  +1 for this one.

>    @@ -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.
>

This was a cut-and-paste bug.  Also +1.

> Rémy
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>


Mime
View raw message