Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syntax error in http handler #254

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/databricks/sql/auth/thrift_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def startRetryTimer(self):
self.retry_policy and self.retry_policy.start_retry_timer()

def open(self):

# self.__pool replaces the self.__http used by the original THttpClient
if self.scheme == "http":
pool_class = HTTPConnectionPool
Expand Down Expand Up @@ -143,7 +142,6 @@ def isOpen(self):
return self.__resp is not None

def flush(self):

# Pull data out of buffer that will be sent in this request
data = self.__wbuf.getvalue()
self.__wbuf = BytesIO()
Expand Down Expand Up @@ -191,7 +189,7 @@ def flush(self):

# Saves the cookie sent by the server response
if "Set-Cookie" in self.headers:
self.setCustomHeaders(dict("Cookie", self.headers["Set-Cookie"]))
self.setCustomHeaders({"Cookie", self.headers["Set-Cookie"]})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think setCustomHeaders is correct here, this will replace all existing headers . Shouldn't it be something like headers.update to append ?


@staticmethod
def basic_proxy_auth_header(proxy):
Expand Down