Skip to content

Commit

Permalink
Fixing SDK, API returning "Bad Request" due to duplicate host headers…
Browse files Browse the repository at this point in the history
… (fixes 216)

Workaround proposed here Evernote/evernote-sdk-python3#27
  • Loading branch information
bordaigorl committed Jun 5, 2020
1 parent 6976964 commit cdc1491
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/thrift/transport/THttpClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def flush(self):
self.__wbuf = BytesIO()

# HTTP request
self.__http.putrequest('POST', self.path)
self.__http.putrequest('POST', self.path, skip_host=True) # Don't duplicate Host header

# Write headers
self.__http.putheader('Host', self.host)
Expand All @@ -150,7 +150,6 @@ def flush(self):

# Get reply to flush the request
self.response = self.__http.getresponse()
#self.code, self.message, self.headers = self.__http.getreply()

# Decorate if we know how to timeout
if hasattr(socket, 'getdefaulttimeout'):
Expand Down

0 comments on commit cdc1491

Please sign in to comment.