mirror of
https://github.com/sivel/speedtest-cli.git
synced 2025-07-21 04:31:17 +02:00
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:
@@ -1522,9 +1522,11 @@ class Speedtest(object):
|
||||
)
|
||||
if pre_allocate:
|
||||
data.pre_allocate()
|
||||
|
||||
headers = {'Content-length': size}
|
||||
requests.append(
|
||||
(
|
||||
build_request(self.best['url'], data, secure=self._secure),
|
||||
build_request(self.best['url'], data, secure=self._secure, headers=headers),
|
||||
size
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user