You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2020/04/13 16:07:32 UTC

[thrift] 02/02: THRIFT-5165: THttpClient saves session cookie. Client: py Patch: Joao Antonio

This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git

commit 69642f389a06f5ba1b374de52c6b0e29892035d8
Author: Joao Antonio <jo...@gmail.com>
AuthorDate: Sat Apr 4 15:39:03 2020 +0100

    THRIFT-5165: THttpClient saves session cookie.
    Client: py
    Patch: Joao Antonio
    
    This closes #2086
---
 lib/py/src/transport/THttpClient.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/py/src/transport/THttpClient.py b/lib/py/src/transport/THttpClient.py
index 37b0a4d..212da3a 100644
--- a/lib/py/src/transport/THttpClient.py
+++ b/lib/py/src/transport/THttpClient.py
@@ -185,3 +185,7 @@ class THttpClient(TTransportBase):
         self.code = self.__http_response.status
         self.message = self.__http_response.reason
         self.headers = self.__http_response.msg
+
+        # Saves the cookie sent by the server response
+        if 'Set-Cookie' in self.headers:
+            self.__http.putheader('Cookie', self.headers['Set-Cookie'])