Commit 45d5a4ac authored by Joshua Roesslein's avatar Joshua Roesslein
Browse files

Fix a bug that would result in a 301 redirect with python 2.5 or older using secure HTTPS.

These versions of python include the port number in the host header.
Twitter will send us a 301 when a host is provided in this manner.
To avoid this redirect this patch manually sets the host w/o the port number.

Fixes issue #12
parent edcae698
......@@ -57,6 +57,12 @@ def bind_api(**config):
else:
self.host = api.host
# Manually set Host header to fix an issue in python 2.5
# or older where Host is set including the 443 port.
# This causes Twitter to issue 301 redirect.
# See Issue http://github.com/joshthecoder/tweepy/issues/#issue/12
self.headers['Host'] = self.host
def build_parameters(self, args, kargs):
self.parameters = {}
for idx, arg in enumerate(args):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment