Modified cookies management in XML-RPC cookie authenticated transport ZTK-1.1
authorThierry Florac <thierry.florac@onf.fr>
Wed, 15 Jul 2015 11:16:10 +0200
branchZTK-1.1
changeset 265 06d455f32dd5
parent 264 4832125dc1f5
child 266 6057769fee72
Modified cookies management in XML-RPC cookie authenticated transport
src/ztfy/utils/protocol/xmlrpc.py
--- a/src/ztfy/utils/protocol/xmlrpc.py	Fri Mar 27 15:45:55 2015 +0100
+++ b/src/ztfy/utils/protocol/xmlrpc.py	Wed Jul 15 11:16:10 2015 +0200
@@ -154,7 +154,10 @@
         if self.cookies is not None:
             crequest = XMLRPCCookieAuthTransport.CookieRequest('http://%s/' % host)
             cresponse = XMLRPCCookieAuthTransport.CookieResponse(response)
-            self.cookies.extract_cookies(cresponse, crequest)
+            for cookie in self.cookies.make_cookies(cresponse, crequest):
+                if cookie.name.startswith('Set-Cookie'):
+                    cookie.name = cookie.name.split(': ', 1)[1]
+                self.cookies.set_cookie(cookie)
         if response.status != 200:
             raise xmlrpclib.ProtocolError(host + handler, response.status, response.reason, response.getheaders())
         return self.parse_response(response)