Skip to content

Commit

Permalink
THRIFT-5165: THttpClient saves session cookie.
Browse files Browse the repository at this point in the history
THttpClient saves the session cookie of an authenticated HTTP
connection. When the Set-Cookie header is present in a response from the
server, its value is saved in the headers of the http session, in the
Cookie header.
  • Loading branch information
joaopedroantonio committed Apr 10, 2020
1 parent dbb95e4 commit b1e0f78
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/py/src/transport/THttpClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,7 @@ def flush(self):
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'])

0 comments on commit b1e0f78

Please sign in to comment.