Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 85431 invoked from network); 8 Feb 2004 17:28:18 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 8 Feb 2004 17:28:18 -0000 Received: (qmail 31752 invoked by uid 500); 8 Feb 2004 17:28:00 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 31708 invoked by uid 500); 8 Feb 2004 17:28:00 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 31692 invoked from network); 8 Feb 2004 17:28:00 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 8 Feb 2004 17:28:00 -0000 Received: (qmail 85408 invoked from network); 8 Feb 2004 17:28:06 -0000 Received: from localhost.hyperreal.org (HELO apache.org) (127.0.0.1) by localhost.hyperreal.org with SMTP; 8 Feb 2004 17:28:06 -0000 Message-ID: <4026719E.8080808@apache.org> Date: Sun, 08 Feb 2004 18:27:58 +0100 From: Remy Maucherat User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm RealmBase.java References: <20040207055432.10928.qmail@minotaur.apache.org> In-Reply-To: <20040207055432.10928.qmail@minotaur.apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Rating: localhost.hyperreal.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N billbarker@apache.org wrote: > billbarker 2004/02/06 21:54:32 > > Modified: catalina/src/share/org/apache/catalina/realm RealmBase.java > Log: > Went back and re-read the spec. > > A url-pattern of /protected/* must match a request for /protected. Hence a special case for this one. > > Revision Changes Path > 1.29 +8 -5 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/RealmBase.java > > Index: RealmBase.java > =================================================================== > RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/RealmBase.java,v > retrieving revision 1.28 > retrieving revision 1.29 > diff -u -r1.28 -r1.29 > --- RealmBase.java 7 Feb 2004 05:24:08 -0000 1.28 > +++ RealmBase.java 7 Feb 2004 05:54:32 -0000 1.29 > @@ -511,7 +511,10 @@ > matched = true; > length = pattern.length(); > } else if(pattern.regionMatches(0,uri,0, > - pattern.length()-1)) { > + pattern.length()-1) || > + (pattern.length()-2 == uri.length() && > + pattern.regionMatches(0,uri,0, > + pattern.length()-2))) { > matched = true; > length = pattern.length(); > } The algortihm from ApplicationFilterFactory is: // Case 2 - Path Match ("/.../*") if (testPath.equals("/*")) return (true); if (testPath.endsWith("/*")) { if (testPath.regionMatches(0, requestPath, 0, testPath.length() - 2)) { if (requestPath.length() == (testPath.length() - 2)) { return (true); } else if ('/' == requestPath.charAt(testPath.length() - 2)) { return (true); } } return (false); } I believe these two should be equivalent now, which is good, but for clarity we should (IMO) use the same. Mine would be less efficient possibly but is probably easier to understand. Obviously, as long as it works, we're fine :) R�my --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org