Fix python3 upload problem
In python3, if Content-length is not set,urllib.request.AbstractHTTPHandler::do_request_() will use "Transfer-encoding:chunked", which will cause HTTPUploader not to exit until timeout
This commit is contained in:
parent
b2654de410
commit
a8a3265001
|
@ -1522,9 +1522,11 @@ class Speedtest(object):
|
||||||
)
|
)
|
||||||
if pre_allocate:
|
if pre_allocate:
|
||||||
data.pre_allocate()
|
data.pre_allocate()
|
||||||
|
|
||||||
|
headers = {'Content-length': size}
|
||||||
requests.append(
|
requests.append(
|
||||||
(
|
(
|
||||||
build_request(self.best['url'], data, secure=self._secure),
|
build_request(self.best['url'], data, secure=self._secure, headers=headers),
|
||||||
size
|
size
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue