----- Original Message ----- From: "Remy Maucherat" <[EMAIL PROTECTED]> To: "Tomcat Developers List" <[EMAIL PROTECTED]> Sent: Sunday, January 11, 2004 1:27 AM Subject: Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm RealmBase.java
> [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). > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]