summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2017-09-02 00:27:58 -0300
committerdrebs <drebs@riseup.net>2017-09-05 11:17:51 -0300
commit303a0cb452c4d252e0204449dd847dabc210e89b (patch)
treea491670c8726c12895db6303683403f222db5a34
parent50140dd980e12523f11c659825d1b0ceef48e970 (diff)
[feat] use cookies in the client syncer
-rw-r--r--src/leap/soledad/client/_http.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/leap/soledad/client/_http.py b/src/leap/soledad/client/_http.py
index 300dc335..101c61be 100644
--- a/src/leap/soledad/client/_http.py
+++ b/src/leap/soledad/client/_http.py
@@ -22,10 +22,11 @@ import base64
from twisted.internet import reactor
from twisted.web.iweb import IAgent
from twisted.web.client import Agent
+from twisted.web.client import CookieAgent
from twisted.web.http_headers import Headers
+from cookielib import CookieJar
from treq.client import HTTPClient as _HTTPClient
-
from zope.interface import implementer
from leap.common.http import getPolicyForHTTPS
@@ -37,7 +38,9 @@ __all__ = ['HTTPClient', 'PinnedTokenAgent']
class HTTPClient(_HTTPClient):
def __init__(self, uuid, token, cert_file):
- self._agent = PinnedTokenAgent(uuid, token, cert_file)
+ agent = PinnedTokenAgent(uuid, token, cert_file)
+ jar = CookieJar()
+ self._agent = CookieAgent(agent, jar)
super(self.__class__, self).__init__(self._agent)
def set_token(self, token):