Author: yoavs
Date: Mon Nov 28 12:49:42 2005
New Revision: 349499

URL: http://svn.apache.org/viewcvs?rev=349499&view=rev
Log:
Bugzilla 37132: http://issues.apache.org/bugzilla/show_bug.cgi?id=37132

Modified:
    
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/authenticator/DigestAuthenticator.java
    tomcat/container/tc5.5.x/webapps/docs/changelog.xml

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/authenticator/DigestAuthenticator.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/authenticator/DigestAuthenticator.java?rev=349499&r1=349498&r2=349499&view=diff
==============================================================================
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/authenticator/DigestAuthenticator.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/authenticator/DigestAuthenticator.java
 Mon Nov 28 12:49:42 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999,2004 The Apache Software Foundation.
+ * Copyright 1999,2004-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -221,9 +221,8 @@
             return (null);
         authorization = authorization.substring(7).trim();
 
-
-        StringTokenizer commaTokenizer =
-            new StringTokenizer(authorization, ",");
+        // Bugzilla 37132: 
http://issues.apache.org/bugzilla/show_bug.cgi?id=37132
+        String[] tokens = authorization.split(",(?=(?:[^\"]*\"[^\"]*\")+$)");
 
         String userName = null;
         String realmName = null;
@@ -235,8 +234,11 @@
         String response = null;
         String method = request.getMethod();
 
-        while (commaTokenizer.hasMoreTokens()) {
-            String currentToken = commaTokenizer.nextToken();
+        for (int i = 0; i < tokens.length; i++) {
+            String currentToken = tokens[i];
+            if (currentToken.length() == 0)
+                continue;
+
             int equalSign = currentToken.indexOf('=');
             if (equalSign < 0)
                 return null;

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=349499&r1=349498&r2=349499&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Mon Nov 28 12:49:42 2005
@@ -110,6 +110,10 @@
       <fix>
         <bug>37668</bug>: Added note about JSP recompilation to Context 
configuration documentation. (yoavs)
       </fix>
+      <fix>
+        <bug>37132</bug>: Have DigestAuthenticator Handle user names with 
commas.  Thanks to 
+          Robert Wille for the patch. (yoavs)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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

Reply via email to