[CalendarServer-changes] [2515] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu May 29 19:40:25 PDT 2008


Revision: 2515
          http://trac.macosforge.org/projects/calendarserver/changeset/2515
Author:   cdaboo at apple.com
Date:     2008-05-29 19:40:24 -0700 (Thu, 29 May 2008)

Log Message:
-----------
No need for explicit unquoting - tokenize takes care of that.

Modified Paths:
--------------
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.auth.digest.patch
    CalendarServer/trunk/twistedcaldav/directory/digest.py

Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.auth.digest.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.auth.digest.patch	2008-05-30 00:10:24 UTC (rev 2514)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.auth.digest.patch	2008-05-30 02:40:24 UTC (rev 2515)
@@ -13,9 +13,14 @@
  
  import md5, sha
  import random, sys
-@@ -320,13 +324,17 @@
-                 return s[1:-1]
-             return s
+@@ -315,18 +319,18 @@
+         @raise: L{error.LoginFailed} if the response does not contain a
+             username, a nonce, an opaque, or if the opaque is invalid.
+         """
+-        def unq(s):
+-            if s[0] == s[-1] == '"':
+-                return s[1:-1]
+-            return s
          response = ' '.join(response.splitlines())
 -        parts = response.split(',')
 -
@@ -31,7 +36,7 @@
 +            auth = {}
 +    
 +            for (k, v) in [parseKeyValue(p) for p in parts]:
-+                auth[k.strip()] = unq(v.strip())
++                auth[k.strip()] = v.strip()
 +        except ValueError:
 +            raise error.LoginFailed('Invalid response.')
 +            

Modified: CalendarServer/trunk/twistedcaldav/directory/digest.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/digest.py	2008-05-30 00:10:24 UTC (rev 2514)
+++ CalendarServer/trunk/twistedcaldav/directory/digest.py	2008-05-30 02:40:24 UTC (rev 2515)
@@ -469,10 +469,7 @@
         @raise: L{error.LoginFailed} if the response does not contain a
             username, a nonce, an opaque, or if the opaque is invalid.
         """
-        def unq(s):
-            if len(s) != 0 and s[0] == s[-1] == '"':
-                return s[1:-1]
-            return s
+
         response = ' '.join(response.splitlines())
         
         try:
@@ -481,7 +478,7 @@
             auth = {}
     
             for (k, v) in [parseKeyValue(p) for p in parts]:
-                auth[k.strip()] = unq(v.strip())
+                auth[k.strip()] = v.strip()
         except ValueError:
             raise error.LoginFailed('Invalid response.')
             

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080529/265758eb/attachment.htm 


More information about the calendarserver-changes mailing list