@@ -53,7 +53,7 @@ class SimpleAsyncHTTPClient(AsyncHTTPClient):
53
53
54
54
Some features found in the curl-based AsyncHTTPClient are not yet
55
55
supported. In particular, proxies are not supported, connections
56
- are not reused, and callers cannot select the network interface to be
56
+ are not reused, and callers cannot select the network interface to be
57
57
used.
58
58
59
59
Python 2.6 or higher is required for HTTPS support. Users of Python 2.5
@@ -310,7 +310,7 @@ def cleanup(self):
310
310
yield
311
311
except Exception , e :
312
312
logging .warning ("uncaught exception" , exc_info = True )
313
- self ._run_callback (HTTPResponse (self .request , 599 , error = e ,
313
+ self ._run_callback (HTTPResponse (self .request , 599 , error = e ,
314
314
request_time = time .time () - self .start_time ,
315
315
))
316
316
@@ -335,7 +335,7 @@ def _on_headers(self, data):
335
335
# use them but if they differ it's an error.
336
336
pieces = re .split (r',\s*' , self .headers ["Content-Length" ])
337
337
if any (i != pieces [0 ] for i in pieces ):
338
- raise ValueError ("Multiple unequal Content-Lengths: %r" %
338
+ raise ValueError ("Multiple unequal Content-Lengths: %r" %
339
339
self .headers ["Content-Length" ])
340
340
self .headers ["Content-Length" ] = pieces [0 ]
341
341
content_length = int (self .headers ["Content-Length" ])
@@ -380,7 +380,7 @@ def _on_body(self, data):
380
380
self .request )
381
381
if (self .request .follow_redirects and
382
382
self .request .max_redirects > 0 and
383
- self .code in (301 , 302 , 303 )):
383
+ self .code in (301 , 302 , 303 , 307 )):
384
384
new_request = copy .copy (self .request )
385
385
new_request .url = urlparse .urljoin (self .request .url ,
386
386
self .headers ["Location" ])
@@ -391,8 +391,8 @@ def _on_body(self, data):
391
391
if self .code == 303 :
392
392
new_request .method = "GET"
393
393
new_request .body = None
394
- for h in ["Content-Length" , "Content-Type" ,
395
- "Content-Encoding" , "Transfer-Encoding" ]:
394
+ for h in ["Content-Length" , "Content-Type" ,
395
+ "Content-Encoding" , "Transfer-Encoding" ]:
396
396
try :
397
397
del self .request .headers [h ]
398
398
except KeyError :
0 commit comments