Commit 6a1e170b authored by Robin Houston's avatar Robin Houston
Browse files

Apply the auth before connecting, otherwise it will fail on reconnection

when using OAuth (because the nonce has been used before, and the timestamp
is no longer correct).
parent a722e487
......@@ -89,7 +89,6 @@ class Stream(object):
def _run(self):
# Authenticate
url = "%s://%s%s" % (self.scheme, self.host, self.url)
self.auth.apply_auth(url, 'POST', self.headers, self.parameters)
# Connect and process the stream
error_counter = 0
......@@ -104,6 +103,7 @@ class Stream(object):
conn = httplib.HTTPConnection(self.host)
else:
conn = httplib.HTTPSConnection(self.host)
self.auth.apply_auth(url, 'POST', self.headers, self.parameters)
conn.connect()
conn.sock.settimeout(self.timeout)
conn.request('POST', self.url, self.body, headers=self.headers)
......
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