[CalendarServer-changes] [13494] twext/trunk/twext/who/opendirectory/_service.py

source_changes at macosforge.org source_changes at macosforge.org
Sun May 18 12:37:07 PDT 2014


Revision: 13494
          http://trac.calendarserver.org//changeset/13494
Author:   sagen at apple.com
Date:     2014-05-18 12:37:07 -0700 (Sun, 18 May 2014)
Log Message:
-----------
Fix formatting of digest response string

Modified Paths:
--------------
    twext/trunk/twext/who/opendirectory/_service.py

Modified: twext/trunk/twext/who/opendirectory/_service.py
===================================================================
--- twext/trunk/twext/who/opendirectory/_service.py	2014-05-17 22:05:48 UTC (rev 13493)
+++ twext/trunk/twext/who/opendirectory/_service.py	2014-05-18 19:37:07 UTC (rev 13494)
@@ -920,21 +920,27 @@
         )
 
         if qop:
-            responseArg = (
-                'username="%s",realm="%s",algorithm=%s,'
-                'nonce="%s",cnonce="%s",nc=%s,qop=%s,'
-                'digest-uri="%s",response=%s'
-                % (
-                    username, realm, algorithm, nonce, cnonce, nc, qop,
-                    uri, response
-                )
+            responseTemplate = (
+                'username="{username}",realm="{realm}",algorithm={algorithm},'
+                'nonce="{nonce}",cnonce="{cnonce}",nc={nc},qop={qop},'
+                'digest-uri="{uri}",response={response}'
             )
         else:
-            responseArg = (
-                'Digest username="%s", uri="%s", response=%s'
-                % (username, uri, response)
+            responseTemplate = (
+                'Digest username="{username}", '
+                'realm="{realm}", '
+                'nonce="{nonce}", '
+                'uri="{uri}", '
+                'response="{response}",'
+                'algorithm={algorithm}'
             )
 
+        responseArg = responseTemplate.format(
+            username=username, realm=realm, algorithm=algorithm,
+            nonce=nonce, cnonce=cnonce, nc=nc, qop=qop, uri=uri,
+            response=response
+        )
+
         # print("username = {0!r}".format(username))
         # print("realm = {0!r}".format(realm))
         # print("uri = {0!r}".format(uri))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140518/8eb7720c/attachment.html>


More information about the calendarserver-changes mailing list